解决使用navicat连接mysql时10060错误

解决使用navicat连接mysql时10060错误,第1张

navicat连接mysql时,出现
一般出现这种错误多是由于服务器未开启3306端口导致的。或者是权限的问题可参考mysql数据库授权。

Centos

# iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
# service iptables save #保存iptables规则

Ubuntu/Debian

# iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
# iptables-save > /etc/iptables.up.rules  #保存iptables规则

数据库授权

# mysql -uroot -p
> grant all username on *.* to username@'%' with grant option; 

#授权语句,特别注意有分号

> flush privileges; #刷新
or
# vim /etc/mysql/mysql.conf.d/mysqld.cnf

将bind-address这行注释到或者改为0.0.0.0

重启mysql

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/992020.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存