I just fixed a small problem. Record it here.
When I use a local tool to connect to MySQL on the test server, the following error occurs: lost.
Connection to MySQL server at 'reading initial communication packet'
First, I want to authorize all IP addresses on the server, so I log on to MySQL using commands on the server and execute:
Grant all privileges on dbname. * To 'username' @ '% 'identified by 'passed'
Here, "%" indicates that IP access is allowed.
Try to connect to the local device.
When I continue my other attempts, I will see a sentence in the error prompt: Check whether the skip-networking settings are removed from MySQL. Open the MySQL configuration file:
VI/etc/MySQL/My. CNF
Note the following:
# Instead of skip-networking the default is now to listen only on
# Localhost which is more compatible and is not less secure.
Bind-address = 127.0.0.1 # Instead of skip-networking the default is now to listen only on
It turns out that the bind-address is bound here. I will comment out the bind-address. That's it!