1. Enter mysqld
If you have set the MYSQL/BIN environment variable, enter the command directly in CMD, if you do not set the MySQL environment variable, go to the MySQL installation directory bin folder run
F:\AppServ\MySQL\bin\mysql.exe-u root-p
Where Root is the username and then you can enter the MySQL command line environment
2. Each subsequent MySQL command, each time with a semicolon, to end the identity, not to enter.
3. Note that every time you need to restart MySQL to make the settings effective!!
Of course, if you add the setting value directly to the MySQL installation directory My.ini, you can load the settings at MySQL startup. Like Connect_timeout = 120
And then what parameters need to be changed to solve the problem
This error often occurs when the Web server is heavily loaded,
Reason:
MySQL default connect_timeout is 5 seconds, more than this time MySQL server side will return "bad handshake".
Solution:
1. Most of the time set "set global connect_timeout=60;" can solve the problem;
We can observe variable_name Value by executing "showstatus like ' aborted% '"
Aborted_clients 6
Aborted_connects 15010
If you feel that you want to increase the connect_timeout time, "aborted_connects" will increase as the server discards the client initial connection. If the "aborted_connects" is large and increasing, "connect_timeout" will need to be added.
2. In the MySQL configuration file [mysqld] Add "skip-name-resolve", reduce the time of domain name resolution
3. Deploying server-side networks is preferable, at least greater than 100mbps/s
4. If the problem arises when calling mysql_query, then you need to adjust the "net_read_timeout" time to 30 seconds, or 60 seconds, or greater values.
5. If the problem is not solved, it is estimated that your SQL statement contains a blob of this large type, we need to increase the value of "Max_allowed_packet"