- 查看用户表,发现目标用户存在且密码正确
select user,host,authentication_string from mysql.user;
- 查看授权,发现为空
show grants for 'user'@'host';
- 给账号进行授权,并刷新权限
grant select on *.* to 'user'@'host' identified by 'password';
flush privileges;
本文介绍了在MySQL中管理用户权限的过程,包括检查用户是否存在且密码正确,查看当前授权情况,以及给指定用户授权并刷新权限。
select user,host,authentication_string from mysql.user;
show grants for 'user'@'host';
grant select on *.* to 'user'@'host' identified by 'password';
flush privileges;
169
272

被折叠的 条评论
为什么被折叠?