当前位置:网站首页>Can't connect to MySQL server on '(10060) solution summary

Can't connect to MySQL server on '(10060) solution summary

2022-07-07 09:45:00 qq_ thirty-six million nine hundred and sixty-seven thousand an

Mode one :
Because the server is not open to the public mysql Default port for 3306 Lead to

CentOs7 The following opening methods

iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

iptables save

service iptables restart

CnetOs7 Opening mode

firewall-cmd --permanent --zone=public --add-port=3306/tcp

firewall-cmd --reload

Mode two :
Failure to set remote user access resulted in

Connect on server mysql

use mysql;

select host,user from user;

±----------±-----+
| host | user |
±----------±-----+
| % | root |
| 127.0.0.1 | root |

host Where is the representative host You can use this user to remotely access % For any

The following opening method is root The user, for example

grant all privileges on . to ‘root’@’%’ identified by ‘root User's password ’;

flush privileges;

Mode three :
If you use alicloud ECS You need to add security group rules manually

Administrative console > example > Click more on the far right > Network and security groups > Security group configuration > Configuration rules > Add security group rule

Finally, restart the server , Generally, it will take effect without restarting

If none of the above methods solve the problem , Try turning off the firewall on this computer

原网站

版权声明
本文为[qq_ thirty-six million nine hundred and sixty-seven thousand an]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130624385488.html