navicat连接阿里云ESC里的数据库

1.进入阿里云服务器

  ssh 用户名@ip

2.进入数据库

  mysql -u root -p 

3.设置mysql数据库权限(允许其他服务器连接数据库)

   grant all privileges on *.* to '用户名'@'%' identified by '密码' with grant option;

   grant all privileges on *.* to 'root'@'%' identified by '123456t' with grant option;

  (ps:想要root用户使用密码123456从任何主机连接到mysql服务器)

1 mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
2 Query OK, 0 rows affected (0.00 sec)
3  
4 mysql>FLUSH PRIVILEGES;
5 Query OK, 0 rows affected (0.00 sec)
修改mysql权限

4.进入数据库mysql查看user表

  select host,user from user

 1 mysql> select host,user from user;
 2 +-------------------------+------+
 3 | host                    | user |
 4 +-------------------------+------+
 5 | %                       | root |
 6 | 127.0.0.1               | root |
 7 | iz2ze3hkpeilimy9kn68tvz |      |
 8 | iz2ze3hkpeilimy9kn68tvz | root |
 9 | localhost               |      |
10 | localhost               | root |
11 +-------------------------+------+
12 6 rows in set (0.00 sec)
查看是否修改成功

5.本地打开Navicat,进行配置

navicat连接阿里云ESC里的数据库_第1张图片

navicat连接阿里云ESC里的数据库_第2张图片

ok,完成设置

转载于:https://www.cnblogs.com/ppzhang/p/9829705.html

你可能感兴趣的:(navicat连接阿里云ESC里的数据库)