欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Navicat远程连接MySQL

程序员文章站 2022-07-10 10:39:04
...

1.在远程服务器先进入mysql

sudo mysql -u root -p

2.在MySQL里面进行操作以下内容:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root');
Query OK, 0 rows affected, 1 warning (0.04 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root' @'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit

3.输入账号密码登录

Navicat远程连接MySQL