GoAdmio Command Line: innodb2myisam with /go/innodb2myisam

Every table in MariaDB/MySQL uses a storage engine. /go/innodb2myisam changes tables from InnoDB to MyISAM. It can convert: MyISAM and InnoDB behave differently, and the change can affect your site. Read Before you convert first. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Convert all InnoDB tables of a database
/go/innodb2myisam shopdb

# Convert one table
/go/innodb2myisam shopdb orders

Options

Form What it does
/go/innodb2myisam <database> Finds every table of the database that uses InnoDB, and converts each one.
/go/innodb2myisam <database> <table> Converts only that table. The command does not check its current engine.
/go/innodb2myisam Asks for the database name, then converts all its InnoDB tables.

To go the other way, use myisam2innodb.

Examples

# Back up the database first
mysqldump shopdb > /root/shopdb.sql

# Convert every InnoDB table of the database
/go/innodb2myisam shopdb

# Convert a single table
/go/innodb2myisam shopdb orders

# Check the engine of each table afterwards
mariadb -e "select table_name, engine from information_schema.tables where table_schema='shopdb'"

Output

For each table, the command prints one line, and then any error from MariaDB:

Converting Table 'orders' to MyISAM...

It prints nothing when the database has no InnoDB tables or does not exist. There is no summary at the end.

The list of table names is saved in /usr/local/goadmio/<database>.txt and is not removed afterwards. Each run also adds a line to /var/log/go/innodb2myisam.log.

See the full reference at /go/innodb2myisam and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

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