Enhancing Performance in WordPress by Moving from MyISAM to Innodb
mysql -uuser -p -e "show tables in db_name;" | tail --lines=+2 | xargs -i echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql mysql -uuser -p db_name < alter_table.sql 2- If you don't have Wordpress installed yet then you have 2 possible choices to make before starting installation: a- For those of you that are feeling lazy, set the default storage engine by adding the line below to my.cnf file and restart mysql:
default-storage-engine=innodb. From this point all new tables will be InnoDB except you set the storage engine in your DDL. b- For those of you who want to make extra work for yourselves and don't want to change your environment, you can modify the installation files that create and modify the schema used by Wordpress. How you can do this? Easy. Let's take a walk on this small how to. Run this shell command inside the Wordpress folder:
find *.php | xargs -n1 sed -i -e 's/) ENGINE=InnoDB $charset_collate;/) ENGINE=innodb $charset_collate;/g' This will change all files that have DDL commands to use ENGINE=innodb during table creation. From now on, every time you install a new Wordpress instance you will have an scalable, high performance and user concurrent application.
On this page
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
Let DataGuard Broker Do ALL The Work
Let DataGuard Broker Do ALL The Work
Feb 18, 2020 12:00:00 AM
2
min read
Debugging MySQL on Docker
Debugging MySQL on Docker
May 30, 2018 12:00:00 AM
4
min read
Deploying Azure Kubernetes cluster with container health monitoring service
Deploying Azure Kubernetes cluster with container health monitoring service
Jun 8, 2018 12:00:00 AM
8
min read
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.