A recent study MySQL, mysql stop fail encountered a problem where the process of solving the problems encountered and write out, the problem is not how hard, but I did not find the solution to this problem during a line of effective solution to the problem of Chinese web pages, and made a lot of wasted time. Here I write down the settlement process, newcomers hope to solve the same problem to save time. Well, ado, we began to enter the topic.
My operating system environment is Ubuntu 14.04,64 bit MySQL installation process is as follows:
Since the change of MySQL configuration file, you need to restart the MySQL, I'll stop mysql through the following two commands:
Of course, also I tried the Internet said the service mysql stop, then do not use eggs. After searching several times, finally found in an English forum solution. In the layout of the problem, there are many respondents given a "method", is given only one method to solve my problem.
The problem solving process is like this:
1, login as root mysql, execute the following sql statement:
select User from mysql.user
Look in the mysql database user table is not the presence of a file named: debian-sys-maint user, the implementation of the above sql statement returns on my machine results
If your query returns results in the absence of a centralized user debian-sys-maint, then you need to perform the second step, if there is debian-sys-maint user, then you need to perform the third step.
2, the implementation of sql statement: CREATE USER 'debian-sys-maint' @ 'localhost' identified by 'password'
I briefly explain the sql statement: create a debian-sys-maint user called, using the mysql password for the user password, then the value of the password field to specify how we do? You are arbitrarily assigned it? Not worth password fields must be the same file /etc/mysql/debian.cnf the debian-sys-maint password contents /etc/mysql/debian.cnf files on my machine
3, if you perform the second step, then you can successfully stop mysql, the need to perform the third step. The third step of the process as follows:
Value /etc/mysql/debian.cnf the debian-sys-maint first execute the following sql statement to see debian-sys-maint line where the password field corresponding to the password is the same,
Since the mysql password is stored encrypted, so we can not compare the two passwords, because we need two passwords are consistent, so execute the following sql statement:
update user set password = PASSWORD ( "password from /etc/mysql/debian.cnf") where User = 'debian-sys-maint'
Here is the password from /etc/mysql/debian.cnf /etc/mysql/debian.cnf file debian-sys-maint corresponding password, you make no mistake.
So that we can successfully stop mysql up.