≡ Menu

MySQL

How to increase MySQL memory limit?

The question - I have a lot of RAM on my machine. How can I increase the memory limits used by MySQL so that MySQL uses more memory and less virtual memory? There are two MySQL variables that can be used to increase the memory limit. One is called key_buffer_size and the other is called [...]

{ 0 comments }

Too many MySQL page faults?

The question is - I use the top command and I see thousands of page faults for the process mysql. Is there a way to reduce the page faults? The command top reports major page faults. Major page faults are requests for data that has to be loaded from the disk. Minor page faults are [...]

{ 0 comments }

How to enable slow query logging in MySQL?

MySQL comes with a built in feature to enable slow query logging. This feature takes in a few arguments and logs all queries that take more than a threshold number of seconds. For example, you can configure MySQL to log all queries that take more than 5 seconds to complete. This is a very useful [...]

{ 0 comments }

The question - How do I know if query caching is enabled on my Linux server? Is there a way to check what the size of the cache is and how to increase the cache size? MySQL comes with a query cache functionality that caches results of frequent queries for shorter execution time. Query caching [...]

{ 0 comments }

The question - How to list and count the number of processes currently running in MySQL? MySQL has several commands that can do this. MySQL has a database called INFORMATION_SCHEMA which keeps track of all the processes currently running. The table in this database called PROCESSLIST has a list of all running processes. First, open [...]

{ 0 comments }

The question - How do I restore my MySQL backup on my new server? I made this back up using the mysqldump command. Is there a command line to restore the backup other than phpMyAdmin? My database is large, so phpMyAdmin does not work. There is a very simple command to restore a MySQL backup [...]

{ 0 comments }

The question is - Is there a way to perform MySQL queries on the SSH command line in the terminal? There is a Linux shell command that ships with MySQL which is called mysql. To access this command, you must first have a user configured for your databases. This can be done using cPanel or [...]

{ 0 comments }

How to optimize MySQL for better performance?

MySQL is a great database engine for small to medium sites and has great performance of SQL queries. I also read somewhere that Google uses MySQL for some of its functionality. MySQL is very rugged but its performance can be greatly improved. MySQL is now owned by Oracle. MySQL is the world's most popular database. [...]

{ 0 comments }

How to empty or drop a MySQL database?

The question is - I need to  empty my MySQL database. I want to delete all tables in it and all the data. Is there a MySQL command or another way to achieve this? There are several ways to do this - one is to use the command line and the other is to use [...]

{ 0 comments }

The question is - how to verify whether MySQL is actually using the index you created on a table in the SQL query? There is a very simple method to do this. Just use the EXPLAIN keyword before the SQL query. By using EXPLAIN before a MySQL query in phpMyAdmin, you see several fields that [...]

{ 0 comments }