Recently I used MySQL databases for Linux projects, but when I remotely connect to MySQL, I always reported erro2003: Can
I recently used MySQL databases for Linux projects. However, when I remotely connect to MySQL, the error "erro 2003: Can" is always reported.
I recently used MySQL databases for Linux projects, but when I remotely connect to MySQL, I always reported erro 2003: Can't connect to MySQL server on '100. 87. ***. * ** '(111). The solution was found several hours yesterday, as shown below:
1. sudo gedit/etc/mysql. my. cnf
Find bind-address = 127.0.0.1
Change to bind-address = 0.0.0.0
2. sudo/etc/init. d/mysql restart
In this case, if you try a remote connection again, ERROR 1130 (HY000): Host '123456. 87. ***. *** 'is not allowed to connect to this MySQL server prompts that the database cannot be remotely connected.
Run the following command on the MySQL host:
Mysql-u root-ppassword // enter the mysql Console
Mysql> use mysql;
Mysql> update user set host = '%' where user = 'root'; // you can skip this error when executing this command.
Mysql> flush privileges;
Mysql> select host, user from user; // check whether '%' is inserted into the database
Mysql> quit