1.登录mysql
mysql -u root p
....
2.修改 Mysql-Server 用户配置
mysql -u root -pvmwaremysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
3.允许远程登录
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
找到bind-address = 127.0.0.1
并且将它注释。
4.重启mysql
sudo /etc/init.d/mysql restart
网友评论