配置MySQL远程连接(ERROR 2003 (HY000): Can‘t connect to MySQL server on ********)

Posted 啊~小 l i

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了配置MySQL远程连接(ERROR 2003 (HY000): Can‘t connect to MySQL server on ********)相关的知识,希望对你有一定的参考价值。

配置mysqlroot远程连接权限

  • 首先要登陆MySQL,然后修改mysql表下面的连接属性由只允许本地连接改为所有ip可以连接
mysql> use mysql; 
mysql> update user set host = '%' where user = 'root'; 
mysql> select host, user from user; 
mysql> flush privileges;

开启防火墙3306端口

firewall-cmd --add-port=3306/tcp

在这里插入图片描述
搞定!

以上是关于配置MySQL远程连接(ERROR 2003 (HY000): Can‘t connect to MySQL server on ********)的主要内容,如果未能解决你的问题,请参考以下文章