Preserve old /etc/mysql/debian.cnf when copying /etc to an other computer

I’ve copied my /var/www, MySQL database, and /etc from a sever to an other server.

After this I found that my MySQL does not work anymore.

The reason for the trouble was that /etc/mysql/debian.cnf contains (twice) an auto-generated password for the database, and so after copying my old /etc directory from my old server the password didn’t match the new password stored in my MySQL database.

The solution: Do not overwrite /etc/mysql/debian.cnf file when copying /etc directory, but leave it as it was autogenerated by the new server installation script.

Note: This is a about Debian Linux.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.