mysql怎么给用户授权 mysql如何给用户授权

mysql怎样添加用户授权方法/步骤
我们以管理员mysql怎么给用户授权的身份先登录到数据库服务器上mysql怎么给用户授权,我想登录到数据库服务器
我先新建一个数据库用户 , 
可以复制权限,这个用户可以访问那几个数据库等 , 是否能删除,修改,添加,等等的一些权限
每个小时的链接数 , 每个小时的查询,最大的并发数,等等
我是选择这个用户只能控制一个数据库的使用,其mysql怎么给用户授权他的数据库不让他看见
我们登录一下这个用户测试一下 , 这个时候你会发现是只有一个自己的数据库其他的数据库就看不见mysql怎么给用户授权了,具体的还有很多的权限控制,这里就不一一介绍啦,
如何设置mysql用户的权限【mysql怎么给用户授权 mysql如何给用户授权】1、创建新用户
通过root用户登录之后创建
grant all privileges on *.* to testuser@localhost identified by "123456" ;//创建新用户,用户名为testuser , 密码为123456 ;
grant all privileges on *.* to testuser@localhost identified by "123456" ;//设置用户testuser,可以在本地访问mysql
grant all privileges on *.* to testuser@"%" identified by "123456" ; //设置用户testuser,可以在远程访问mysql
flush privileges ;//mysql 新设置用户或更改密码后需用flush privileges刷新MySQL的系统权限相关表,否则会出现拒绝访问 , 还有一种方法,就是重新启动mysql服务器 , 来使新设置生效
2、设置用户访问数据库权限
grant all privileges on test_db.* to testuser@localhost identified by "123456" ;//设置用户testuser,只能访问数据库test_db , 其他数据库均不能访问 ;
grant all privileges on *.* to testuser@localhost identified by "123456" ;//设置用户testuser,可以访问mysql上的所有数据库 ;
grant all privileges on test_db.user_infor to testuser@localhost identified by "123456" ;//设置用户testuser,只能访问数据库test_db的表user_infor , 数据库中的其他表均不能访问 ;
3、设置用户操作权限
grant all privileges on *.* to testuser@localhost identified by "123456" WITH GRANT OPTION ;//设置用户testuser,拥有所有的操作权限,也就是管理员 ;
grant select on *.* to testuser@localhost identified by "123456" WITH GRANT OPTION ;//设置用户testuser , 只拥有【查询】操作权限 ;
grant select,insert on *.* to testuser@localhost identified by "123456";//设置用户testuser,只拥有【查询\插入】操作权限 ;
grant select,insert,update,delete on *.* to testuser@localhost identified by "123456";//设置用户testuser , 只拥有【查询\插入】操作权限 ;
REVOKE select,insert ON what FROM testuser//取消用户testuser的【查询\插入】操作权限 ;
如何给MySql创建连接用户并授权如何给MySql创建连接用户并授权
grant all privileges on *(权限数据库).*(权限表) to '(用户名)'@'(IP)'identified by '(密码)';
创建用户并授予某个库某个表所有权限
mysql怎么给用户授权的介绍就聊到这里吧 , 感谢你花时间阅读本站内容,更多关于mysql如何给用户授权、mysql怎么给用户授权的信息别忘了在本站进行查找喔 。

    推荐阅读