, ,

Recently, when we were moving our staging applications and databases to a different server (from Win 2003 to Ubuntu 9.04), we had two problems with the MySQL server.

One, easy to fix, was the case-sensitive nature of table names. Using lower_case_table_names=1 in /etc/mysql/my.cnf fixed the problem.

The other problem riddled the server startup and shutdown (even server status) with errors, even while keeping the server functional. When looking into the error messages, I found out that there is a special MySQL user named ‘debian-sys-maint’ which has admin privileges. This account is used to shut down the server gracefully, to check for corrupt tables etc. The password for this account is stored in plaintext in the file /etc/mysql/debian.cnf.

Error message obtained:

/usr/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)’


GRANT ALL PRIVILEGES ON *.* TO ‘debian-sys-maint’@’localhost’ IDENTIFIED BY ‘<password>’ WITH GRANT OPTION;

where <password> is the plain text password found in /etc/mysql/debian.cnf. Found the fix here.