29 C
Texas
angeloma
Senior Writer and partner

How to change MySQL / MariaDB storage engine to a WordPress site?

Hi, folks. In this post, we will help you to change the MySQL / MariaDB storage engine to a WordPress site. Particularly we’ll change all to InnoDB but also the procedure works for MyISAM.

Previously we explained that the storage engine is a fundamental component of database managers. With them, we define many ways about how our data is stored. Also, it is good to say that there are many and all are good but each in certain circumstances.

So, if your WordPress site needs a change of storage engine, in this post we will tell you how to do it easily and safely.

Previous steps

In this post, it is assumed that WordPress is already installed and running. If not, there are our posts that will help you install it without problems.

- Advertisement -

How to install WordPress on Ubuntu 20.04?
How to install WordPress on Debian 10?

To facilitate the whole process, we have chosen to use also PHPMyAdmin as a tool. This will help us with some steps.

How to install PHPMyAdmin on Ubuntu 20.04?
How to install PHPMyAdmin on Debian 10?

With this done, we can start.

Changing MySQL / MariaDB storage engine for a WordPress site

Open your web browser and open PHPMyAdmin. You will see the following screen:

1.- PHPMyAdmin main screen
1.- PHPMyAdmin main screen

As you can see in the image, I have a database called wordpress which is where the site data is.

The process is quite safe but it is always convenient to make a backup of the database.

So, select the wordpress database and go to the Export tab and make a backup of the whole database by pressing the Go button.

2.- Making a wordpress data backup
2.- Making a wordpress data backup

Perhaps the fastest method is to use SQL code. So, click on the SQL tab.

3.- SQL tab on PHPMyAdmin
3.- SQL tab on PHPMyAdmin

What we have to do is modify each table that makes up the WordPress database. As I am using a recent installation of WordPress you may have many more tables.

So, in my case these are the lines I have to run:

ALTER TABLE wp_commentmeta ENGINE=InnoDB;
ALTER TABLE wp_comments ENGINE=InnoDB;
ALTER TABLE wp_links ENGINE=InnoDB;
ALTER TABLE wp_options ENGINE=InnoDB;
ALTER TABLE wp_postmeta ENGINE=InnoDB;
ALTER TABLE wp_posts ENGINE=InnoDB;
ALTER TABLE wp_termmeta ENGINE=InnoDB;
ALTER TABLE wp_terms ENGINE=InnoDB;
ALTER TABLE wp_term_relationships ENGINE=InnoDB;
ALTER TABLE wp_term_taxonomy ENGINE=InnoDB;
ALTER TABLE wp_usermeta ENGINE=InnoDB;
ALTER TABLE wp_users ENGINE=InnoDB;

Remember that if you want to change to MyISAM you only have to modify the commands, for example:

ALTER TABLE wp_commentmeta ENGINE=MyISAM;

Then click on the Go button.

4.- Changing the MySQL / MariaDB storage engine for a WordPress site
4.- Changing the MySQL / MariaDB storage engine for a WordPress site

Then you will see a screen where you can see that each modification has been done correctly.

5.- Everything is OK
5.- Everything is OK

And you will continue to enjoy your website without any problems.

6.- WordPress site working after changing MySQL / MariaDB storage engine
6.- WordPress site working after changing MySQL / MariaDB storage engine

So, enjoy it.

Conclusion

Changing the storage engine of all the tables in a WordPress site can be helpful for your site. The process is quite simple, but it is always advisable to do it after backing up our database.

So, share this post and join our Telegram Channel.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article