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
Written by Alan Ivey
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#