“error 2003: can’t connect to mysql server on ‘***’ (10061)” Google翻译:错误2003:无法连接到“**”上的mysql服务器(10061)
[mysqld]
bind-address=0.0.0.0 # 表示允许任何主机登陆MySQL
port=3306 # 表示MySQL运行端口为3306
mysql> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.00 sec)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host,user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | root |
| % | zijing |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
+-----------+------------------+
5 rows in set (0.00 sec)
我以为可能是防火墙原因,但之前已经将3306端口暴露出来了
官网地址:传送门
成功了,想起来前辈说的那句话,每次遇到一些莫名其妙的错误,怎么都排查不出来的时候,那个错误一定是个非常无脑的问题。