InnoDB is a more robust and better database table type for modern applications like Wordpress, Joomla, etc.. compared to the older MyISAM table type. With InnoDB, you should see improvements in platform I/O, your sites should perform better and faster, and they should better survive database hiccups that can occur, too. MODX Revolution 2.6 will default to InnoDB for new installations, if supported.
The steps below will allow you to update existing installations to support InnoDB tables today.
First, ALWAYS back up your database before doing anything potentially destructive. Once you have that done, you're ready to go:
- Launch PMA. You must explicitly click on the name of your database in the top of the left column. _There are sometimes multiple databases, so make sure to click the right one. Do not click on the one labelled
information_schema
._ - Click the Query tab
-
In the box at the lower right, paste the following code into the "SQL query on database …" box, replacing "your-db-name" with your actual DB name:
SELECT CONCAT('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;') FROM INFORMATION_SCHEMA.TABLES WHERE ENGINE='MyISAM' AND table_schema = 'your-db-name';
- Press the submit query button to see a list of tables to alter to InnoDB
- Click the "+Options" button above the results, choose the "Full texts" option, and press the "Go" button in the shaded area at the lower right
- Above the results, tick the "Show all" checkbox
- Copy all the queries using the "Copy to clipboard" link in the "Query results operations" box below the results
- Paste the result into a text editor and copy all the lines starting with "ALTER TABLE" to your clipboard
- Click the SQL tab above the results
- Paste the ALTER TABLE statements into the textarea and press the "Go" button in the lower right shaded area
To confirm your database was successfully converted, click your database name in the left column, and all table types should now say InnoDB.