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

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; /*刷新权限*/
posted @ 2019-08-13 14:13  Xieth  阅读(15021)  评论(0编辑  收藏  举报