Solution: 1. Enter mysql on the command line to enter interactive mode, and use the "SET GLOBAL connect_timeout = 60;" command to modify the global timeout; 2. Search for services in the start menu and enter the system In the service list, find mysql in the service list, right-click and select Start, and reconnect.
The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.
About the problem of mysql connection 2013 error (as shown below)
mysql2013 error code prompts and The mysql service has lost its connection, which means that mysql cannot connect to the server. The reasons for this problem include network, timeout, port occupation, etc. The specific solution must be modified according to different reasons.
1. If this error occurs after a while when connecting to the mysql database, it is because the service connection is disconnected by the set timeout configuration before the database is successfully connected due to network delay. Just set the timeout longer. Enter mysql on the command line to enter interactive mode, and then execute the following command to modify the global timeout:
SET GLOBAL connect_timeout = 60;
2. If this error occurs immediately after connecting, it means that the mysql service on the computer has not been started. Search for services on the start menu and enter the system's service list. Find mysql in the service list, right-click and select Start, and then reconnect.
If this error occurs when connecting to the remote mysql database service, it should be because there is a firewall or secure network access restriction on the system. Just modify the configuration file. . Find my.ini in the mysql installation directory and open it in Notepad, then add the skip-name-resolve configuration content after the mysqlid attribute in the configuration file and save it.
Recommended learning: mysql video tutorial
The above is the detailed content of How to solve mysql error 2013. For more information, please follow other related articles on the PHP Chinese website!