MySQL Storage Engine – How to Convert MyISAM to InnoDB

The affects of Web Hosts on Your Business Website

Here're ways your choice of web hosting service provider impacts the performance of your business:


check

Website loading speed

check

Uptime and availability

check

Customer support

check

Security

check

Server location

MySQL Storage Engine – How to Convert MyISAM to InnoDB

MySQL Storage Engine – How to Convert MyISAM to InnoDB

Storage Engine

Overview

Large-scale WordPress sites slow down for a variety of reasons, one of which being a database that hasn’t been optimized. In their databases, many older sites still use the MyISAM storage engine. InnoDB has shown to run better and be more reliable in recent years. The lack of full table-level locking is a major advantage of InnoDB versus MyISAM. This helps your queries to run more quickly.

InnoDB vs MyISAM
Do you use MyISAM or InnoDB for your database?
phpMyAdmin can convert MyISAM to InnoDB.
WP-CLI can convert MyISAM to InnoDB.
MyISAM vs. InnoDB
Here are a few key distinctions between InnoDB and MyISAM:

Row-level locking is available in InnoDB. Only full table-level locking is available in MyISAM.
Referential integrity is a feature of InnoDB that includes support for foreign keys (RDBMS) and relationship restrictions, which MyISAM lacks (DMBS).
Transactions are supported by InnoDB, thus you can commit and rollback. MyISAM, on the other hand, does not.
Because it employs transactional logs for auto recovery, InnoDB is more dependable. MyISAM, on the other hand, does not.
Are You Using MyISAM or InnoDB?
If you’re using WordPress for the first time, you’re probably already utilizing the InnoDB MySQL storage engine. However, if you have an older WordPress site, you should perform a fast check. Some sites may even have tables that are mixed and matched between MyISAM and InnoDB, which could benefit from conversion. To check, simply follow the steps below.

Step 1: Open phpMyAdmin and navigate to the mySQL database.

2nd Step
You can see which Storage Engine types your tables are utilizing by scanning or sorting the “Type” column. You can see that two of the tables are still utilizing MyISAM in the example below.

myisam tables can be found
Look for MyISAM tables.
You might also use a query to see whether any myISAM tables exist. Replace ‘database’ with the name of your database.

FROM information schema, SELECT TABLE NAME, ENGINE.

TABLES IN WHICH TABLE SCHEMA IS ‘database’ AND ENGINE IS’myISAM’
Convert MyISAM to InnoDB with phpMyAdmin
You may easily convert MyISAM to InnoDB. The wp comments table is used in this example. To convert it to the InnoDB storage engine, simply use the ALTER command. Note: Before performing any operations on your MySQL database, we always recommend backing it up.

TABLE CHANGE wp comments ENGINE=InnoDB; Make sure you’re using MySQL 5.6.4 or higher; otherwise, you might run into problems because InnoDB doesn’t support full-text indexing yet. You don’t have to worry about this if you’re a Kinsta customer.
Alternatively, you can use phpMyAdmin to manually convert them. Simply go to the “Operations” tab on the myISAM table and change the storage engine.

myisam table to innodb conversion phpmyadmin
MyISAM to InnoDB conversion

Convert MyISAM to InnoDB with WP-CLI

WP-CLI is a command-line tool that allows developers to manage basic (and not-so-common) WordPress operations. Check out this article on using WP-CLI to convert MyISAM to InnoDB.

Save time, money, and improve site performance by using:

Expert WordPress hosting assistance is available 24 hours a day, 7 days a week.
Integration with Cloudflare Enterprise.
With 29 data centers across the world, we can reach a global audience.
With our built-in Application Performance Monitoring, you can improve your performance.
All of this and more is included in a single plan that includes no long-term obligations, aided migrations, and a 30-day money-back guarantee. Check out our plans or speak with a sales representative to find the ideal plan for you.