Mysql is installed on the internal test server. It is okay to log on to the database locally on the server, but remote logon is not allowed. Try to use the telnet command to connect to the mysql server. The command line displays the following prompt:
Telnet 192.168.41.191 3306
Trying 192.168.41.191...
Connected to 192.168.41.191.
Escape character is '^]'.
G Host '192. 168.41.186 'is not allowed to connect to this MySQL serverConnection closed by foreign host.
At first, I suspected that the firewall port was not opened. I directly shut down the firewall.
Then I wonder if the router has set any rules for server access. No filtering rules are added to the vro. The problem should not be caused by the vro.
Later I found that mysql did not enable remote logon by default. It was so embarrassing that I was too ignorant.
Then you can find the method to enable remote logon. As follows:
Modify the localhost data of the host field of the mysql database table user to "%"
On the mysql Console, enter flush privileges
Commit
After completing these three steps, you can use the remote machine to log on to mysql again and connect to mysql.