MySQL is the most commonly used Relational Database Management System(RDMS) for the Web. It is open source and has a free community version. It provides all those features that can be provided by an enterprise-level database.
The default settings provided with the MySQL installation may not be so good
for performance, and there are always ways to fine-tune these settings to get an improved performance. Also, remember that your database design plays a big role in performance. A poorly designed database will have an effect on the
In this post, we will discuss how to improve the MySQL database's performance.
Query caching is an important performance feature of MySQL. It caches SELECT
queries along with the resulting dataset. When an identical SELECT query occurs,
MySQL fetches the data from memory so that the query is executed faster and
thus reduces the load on the database.
To check whether query cache is enabled on a MySQL server or not, issue the
following command in your MySQL command line:
to use this command in production, open phpmyadmin from cpanel, click on terminal, enter the command bellow and press ctrl+enter (not only enter) to run the command
SHOW VARIABLES LIKE 'have_query_cache';
The preceding command will display the following output:
The previous result set shows that query cache is enabled. If query cache is disabled,
the value will be NO .
To enable query caching, open up the my.cnf file and add the following lines. If
these lines are there and are commented, just uncomment them:
query_cache_type = 1 query_cache_size = 128MB query_cache_limit = 1MB
Save the my.cnf file and restart the MySQL server.