Home > Database > Mysql Tutorial > Solution to SQL Error (2013) connection error in MySQL_MySQL

Solution to SQL Error (2013) connection error in MySQL_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-06 13:32:48
Original
1239 people have browsed it

Phenomena description
Today I used heidisql to log in to the MySQL of the virtual machine, but I couldn’t log in. After waiting for about a minute or two, an error message appears: SQL Error (2013): Lost connection to MySQL server at 'waiting for initial communication packet', system error: 0, as shown in the picture below:

2016627174208140.png (706×126)

At first I thought it was a remote TCP/IP. Root can only be accessed through localhost. Later, I created a new user and changed it to %, but still to no avail. The problem disappeared after trying to modify the my.ini configuration problem.

Solution
In my.ini or my.cnf
In the [mysqld] item, add

skip-name-resolve
Copy after login

While solving this problem, another startup parameter was discovered:

skip-grant-tables
Copy after login
Copy after login

mysql startup parameters:

skip-grant-tables
Copy after login
Copy after login

As the name suggests, grant-tables, the authorization table, is not started when starting mysql. What is the use? Of course, it is useful when you forget the administrator password or there is a problem with the user table in the mysql database. Using this parameter, any account can log in to the mysql database with any password (including empty, of course).

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template