进入mysql
mysql>use mysql; mysql>update user set host = ‘%‘ where user = ‘root‘; mysql>flush privileges; mysql>select host, user from user;
修改/etc/mysql/my.cnf,
把bind-address = 127.0.0.1
改成bind-address = 0.0.0.0
[email protected]:~# vi /etc/mysql/my.cnf # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. #bind-address = 127.0.0.1 bind-address = 0.0.0.0
改完保存后, 重启mysql
[email protected]:~# service mysql restart
时间: 2024-11-07 02:32:25