远程连接Ubuntu上的mysql
- 打开命令窗口运行:
mysql -u root - p
- use mysql;
- update user set host = “%” where user =“root”;
- flush privileges;
- select “host”,“user” from user where user=“root”;
- 重启mysql服务
如果还是不可以可以尝试修改、sudo vim /etc/mysql/mysql.conf.d/ mysqld.cnf
注释掉 bind-address =127.0.0.1