optimize and purge mysql data

29/04/2016

mysqldump -u root -p --databases echo "show databases" | mysql -u root -p | grep -Ev "^(Database|mysql|performance_schema|information_schema)$" > mydb.sql

service mysql stop
remove your databases and ib*. Keep mysql, performance_schema, ...
cd /var/lib/mysql && rm -rf ib* {{{{{{{databases}}}}}}}

Add the following lines to /etc/mysql/my.cnf
[mysqld]
innodb_file_per_table=true

service mysql start
mysql -u root -p < mydb.sql

Raccourcis