Reference:
http://blog.csdn.net/apple9005/article/details/53033148
Issue one: When connecting to server MySQL via Navicat under the host, Prompt "2003 Can ' t connect to MySQL server on ' xxx.xxx.xxx.xxx ' (10038)"
Cause: Server 3306 remote port is not open
Solve:
1. First check if the port is open, command: Netstat-an|grep 3306
The 127.0.0.1:3306 is displayed, indicating the local
2. Open MySQL config file, command: sudo vim/etc/mysql/mysql.conf.d/mysqld.cnf
Unregister bind-address = 127.0.0.1
3. Restart the database
Execute Netstat-an|grep 3306 again, and the discovery has changed.
Problem two: After solving the problem, using host Natcivat to connect the server MySQL again, there is another error prompt: 1130-host ' XXX.XXX.XXX. XXX ' is not allowed to connect to this MySQL server
Cause: Remote server does not have permission to log on to MySQL
Solve:
1.Ubuntu Login Mysql:mysql-uroot-p
2. Execute the next command
GRANT all privileges on * * to ' Your user name ' @ '% ' identified by ' Your database password ' with GRANT OPTION;
3. Under the implementation
Flush privileges;
This command refreshes the permissions without restarting
The above is only for versions below 5.7.
More than 5.7 will report errors when executed.
- Mysql> Grant all privileges on * * to ' XXX ' @ '% ' identified by ' zzzzz ' with GRANT OPTION;
- ERROR 1820 (HY000): Must reset your password using ALTER USER statement before executing this statement.
- Mysql> exit
At this point, you need to perform the Refresh permission first:
- Flush privileges;
Remote connection to MySQL via Navicat