How to Fix MySQL Error “Stopping MySQL database server : mysqld failed!” on Debian Squeeze

This problem happens when you modify user table in mysql database. In Debian system, there is a user named debian-sys-maint. We can’t restart mysql daemon if the password is not correct. We have to update the password for that user.

# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld failed!
Starting MySQL database server: mysqld already running.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'    

First, we check the password:

# cat /etc/mysql/debian.cnf  | grep password

password = oY7nuYwX9jUsDuN

Login to mysql shell as root

# mysql -u root -pyour_root_password

Now use the following command to update the debian-sys-maint user password:

GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'the_password' WITH GRANT OPTION;  

Replace <password> with oY7nuYwX9jUsDuN.

It’s done.

Now test by restart mysql daemon.

# /etc/init.d/mysql restart

Keywords:

  • stopping mysql database server: mysqld failed!
Comments
  1. shanigan Reply

Leave a Reply

Your email address will not be published. Required fields are marked *