How to create MySQL data directory with mysql_install_db

On a Debian 7 server, the MySQL database got corrupted, which caused the MySQL database to keep crashing. I was able to take a backup of the database following InnoDB Recovery instructions at

https://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html

Once I have the Database backup taken, I took a backup of the MySQL data directory /var/lib/mysql and removed it.

To recreate the MySQL data directory, I run the mysql_install_db command, but it failed with the error message “FATAL ERROR: Could not find my-default.cnf”

It is fixed by copying /etc/mysql/my.cnf to /usr/share/mysql/my-default.cnf

Back to MySQL

Need help with Linux Server or WordPress? We can help!

Leave a Reply

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