Best method for stopping/starting MySQL?
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
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?