# 先进入mysql
mysql -u root -p
# 输入对应的密码后进入
# 切换数据库为mysql
use mysql;
# 查看现有用户信息;
select user, host from user;
# 如果Host有对应的IP,可以通过以下语句查询授权信息,username和host为上面对应的user,host,如果要对所有IP放开限制将host写成%即可
show grants on for 'useraname'@'host';
# 如果没有则需要先新建一个对应的用户
create user 'username'@'host' identified by 'password';
# 之后再给新建的用户赋权
grant all on *.* to 'username'@'host';
# 刷新权限
flush privileges;
12-05
5741
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-05
3626
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-09
3227
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-18
977
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交