xietianhua

MySql授予用户指定数据库权限

/*授予用户通过外网IP对于该数据库的全部权限*/

  grant all privileges on `test`.* to \'test\'@\'%\' ;

  /*授予用户在本地服务器对该数据库的全部权限*/

  grant all privileges on `test`.* to \'test\'@\'localhost\';   

   grant select on test.* to \'user1\'@\'localhost\';  /*给予查询权限*/

   grant insert on test.* to \'user1\'@\'localhost\'; /*添加插入权限*/

   grant delete on test.* to \'user1\'@\'localhost\'; /*添加删除权限*/

   grant update on test.* to \'user1\'@\'localhost\'; /*添加权限*/

  flush privileges; /*刷新权限*/

分类:

技术点:

相关文章: