lz0qsa
Last Updated: February 25, 2016
·
3.136K
· alanthing
3647818866d8fc48e8176c04b5a77efc

Convert all MyISAM tables to Aria

If you switched from MySQL to MariaDB and would like to convert your MyISAM tables to the crash-safe Aria engine, you can do it in one command:

for i in $(mysql --skip-column-names --silent -e'show databases;'|grep -Ev '(mysql|_schema|runtime)'); do mysql --skip-column-names --silent -e"SELECT table_name FROM information_schema.TABLES WHERE TABLE_SCHEMA = '$i' AND engine = 'MyISAM'" | xargs -I{} mysql -e"ALTER TABLE {} ENGINE='ARIA' TRANSACTIONAL=1;" $i; done
Say Thanks
Respond