发布于 4年前

ERROR 2003 (HY000): Can't connect to MySQL server (111)

1、修改配置文件
vim /etc/mysql/my.cnf
修改bind-address = 0.0.0.0
2、授权
GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'sjgj2508' WITH GRANT OPTION;
FLUSH PRIVILEGES;
3、重启mysql
sudo service mysql restart
4、修改防火墙规则
sudo iptables -A INPUT -i eth0 -s 192.168.1.0/24 -p tcp --destination-port 3306 -j ACCEPT

©2020 edoou.com   京ICP备16001874号-3