|
1.在xshell上登录mysql服务器
[root@hecs-x-xlarge-2-linux-20210525120229 ~]# mysql -uroot -123456
2.显示所有数据库
mysql> show databases;
3.切换到mysql数据库
mysql> use mysql;
4.设置所有ip都能访问mysql的root用户(其中 '%'表示允许所有机器能访问root用户,'root'表示想要被连接的数据库的用户名)
mysql> update db set host = '%' where user = 'root';
5.重新加载一下mysql权限,这一步必须有
mysql> flush privileges;
6.给http://IP-xxx.xxx.xxx.xxx赋予了所有的权限,包括远程访问权限( '%'百分号表示允许任何IP访问数据库,'jcsl@361000'表示想要被连接的数据库的用户密码)
mysql> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option; |
|