InMotion Hosting Support Center

Note that you will need root access in order to use these directions.

In this guide, we will go over how to optimize your MySQL service for fast queries and load times. You will need to log into the command line interface as the root user to continue on with this tutorial.

Query Cache

Query cache stores select statements used so when the statement is called again it will provide the same result if instead of running it against the system. If you make edits to the table the cache is flushed and will re-cache once the query is run again. This way your website will not be providing outdated content.

  1. Log in to your server via SSH as the "root" user.
  2. Enter the MySQL interface.
    mysql
  3. Check to see if Query Cache is already enabled.
    SHOW VARIABLES LIKE 'query_cache_type';
  4. Exit the MySQL interface.
  5. If you need to enable Query Cache then edit the /etc/my.cnf file with your desired editor.
    vim /etc/my.cnf
  6. Search for the links query_cache_type.
  7. Change the query_cache_type to 1 instead of 0 and change query_cache_size to 16M.
  8. Restart MySQL for the changes to take effect.
    service mysql restart or /etc/init.d/mysql restart

MySQL Tuner

This script performs many functions but mostly checks for fragmented tables that need to be repaired, uptime statistics, and security issues that it may find.

  1. Log in to your server via SSH as the "root" user.
  2. Change to the /usr/src/ directory.
    cd /usr/src/
  3. Download the mysqltuner.pl script.
    wget http://mysqltuner.pl -O mysqltuner.pl
  4. Run the downloaded script.
    perl mysqltuner.pl
  5. At this time the program will try to tune your MySQL installation. It will also show any errors it finds.

Congratulations, now you know how to optimize your MySQL service for fast queries and load times.

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!