[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Best method for stopping/starting MySQL?

19.10.2009 20:49, Tim Legg kirjoitti:
Hello again!

I would like to shutdown mysql periodically to make backups of the databases.  I would like to know what is the official Debian way of stopping and restarting MySQL.

When I follow the intuitive steps for shutting it down, it doesn't work.

# /etc/init.d/mysql stop
Stopping MySQL database server: mysqld failed!

So I investigate further and find that this doesn't work either

# mysqladmin shutdown
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

I am root and should be able to do anything...

So I do cooperate and provide it a user and password

# mysqladmin -u root -p shutdown
Enter password:

And so it works.  Starting it back up isn't nearly as clean though

# /etc/init.d/mysql start
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

So, I choose to reboot the system instead.  Is there a better way?

Something is broken in your installation.. Do you have


And the password there.

If you log in to the MySQL as root, and

    mysql> select User, Host from mysql.user;

Is the debian-sys-maint there? With the password you have in the
debian.cnf? And Host as 'localhost'?

You can change the password with command

    mysql> update mysql.user set password=PASSWORD('new-password')
         where User = 'debian-sys-maint' ;
    mysql> flush privileges;


Good day for a change of scene.  Repaper the bedroom wall.

Attachment: pgpdPoEbxZPP5.pgp
Description: PGP signature

Reply to: