- Dump all databases by calling:
mysqldump --extended-insert --all-databases --add-drop-database --disable-keys --flush-privileges --quick --routines --triggers > all-databases.sql
- Stop the MySQL server;
- Rename or remove (in case you’ve already backed it up) the MySQL data directory and create an empty one with the same name and permissions;
- Make the appropriate changes in my.cnf;
innodb_file_per_table - Re-initialize the database with the following command (replace the ‘mysqld‘ with the login of the user your MySQL server runs as):
sudo -u mysqld mysql_install_db
- Start the MySQL server;
- Get into the ‘mysql‘ console and type:
SET FOREIGN_KEY_CHECKS=0;
SOURCE all-databases.sql;
SET FOREIGN_KEY_CHECKS=1; - Restart the MySQL server.