Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL 连接错误 (61) #4

Open
nodejh opened this issue Nov 22, 2016 · 1 comment
Open

MySQL 连接错误 (61) #4

nodejh opened this issue Nov 22, 2016 · 1 comment
Labels

Comments

@nodejh
Copy link
Owner

nodejh commented Nov 22, 2016

远程连接 MySQL 的时候出现如下错误:

Can't connect to MySQL server on '*.*.*.*' (61)

这是因为 MySQL 默认的 bind-address127.0.0.1, 也就是限制了只能本地访问.

所以解决方法之一,就是修改 bind-address.

改为 0.0.0.0 ,任何远程 IP 都能访问.你也可以把它改为你的电脑的 IP,只能你自己访问.

修改后,重启就好了:

$ sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
# 修改 bind-address
$ sudo service mysql restart
@nodejh nodejh added the MySQL label Nov 22, 2016
@nodejh
Copy link
Owner Author

nodejh commented Apr 4, 2017

开启远程连接:grant all privileges on *.* to 'root'@'%' identified by 'password';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant