2003-Can't connect to MySQL server on (10061)错误

先用终端连接数据库

给用户授权

mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";
mysql> flush privileges;

cd /etc/mysql/mysql.conf.d/

修改mysqld.cnf文件

vim mysqld.cnf

2003-Can't connect to MySQL server on (10061)错误_第1张图片
sql2.png
bind-address            = 0.0.0.0
2003-Can't connect to MySQL server on (10061)错误_第2张图片
sql1.png

把bind-address =127.0.0.1 修改成 =bind-address =0.0.0.0

bind-address =127.0.0.1 只能本地访问

bind-address =0.0.0.0 不限制访问

你可能感兴趣的:(2003-Can't connect to MySQL server on (10061)错误)