≡ Menu

MySQL

phpMyAdmin: mbstring PHP extension not found error

Question - When I open phpMyAdmin, I get the following error: The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results. How do I fix this? The solution is to install [...]

{ 0 comments }

Clear MySQL command line query history

Question - I wish to clear the ~/.mysql_history file and want it to not keep the history recorded. Is there a way to do this? MySQL stores all command line queries in a special file called ~/.mysql_history. This file is written by MySQL whenever you run a command line query using SSH or a local [...]

{ 0 comments }

Change MySQL wait_timeout variable

MySQL wait_timeout variable represents the number of seconds that MySQL will wait till it closes idle connections. The default value is 28800 seconds (8 hours). This may be too high for most websites! If you have a very high traffic website and your database queries all complete is less than a few seconds, there is [...]

{ 0 comments }

MySQL List Idle Connections

Question - How do I list idle connections in mysql? I sometimes see a too many connections error. I need to terminate idle connections automatically. How do I do that? You can list all processes that MySQL is currently running using the following command: First open a mysql command prompt: mysql -u dbusername -p Then [...]

{ 0 comments }

How to check if MySQL server is running on Linux?

Question - I have a CentOS Linux web hosting server and I need to check whether MySQL is running. How do I check this? I am getting the following error: can't connect to MySQL server on localhost. Is there a way to debug this problem? There are several things to check whether MySQL is already [...]

{ 0 comments }

How to find MySQL queries per second on my Linux box?

The question - I want to find out what load my MySQL database runs under. So if I could get the queries per second that the MySQL database serves, that would be great. Is there a mysqld directive or command that can get queries per second? There is a mysqladmin command that can give you [...]

{ 0 comments }

How to check MySQL database disk usage?

Question - I need to check how much disk space is used by my MySQL databases. Is there a Linux command that can check this? There is a Linux command that can output the disk space used by any directory. This command is called du which stands for disk usage. To check the disk usage [...]

{ 0 comments }

Most important MySQL performance tuning variables

The question - What are the most important and useful MySQL performance tuning variables that I should be aware of? I am currently tuning my database for maximum performance and was wondering what options should I be changing. There are several MySQL performance tuning variables that I will discuss in this tutorial. I will discuss [...]

{ 0 comments }

Question - I am tuning MySQL on my Linux box and my question is what is the recommended value of the variable key_buffer_size in MySQL? Should I increase it for better performance? The key_buffer_size indicates the size of the key cache that MySQL uses to store indexes in memory. The cache stores index blocks in [...]

{ 2 comments }

The question - What is the recommended size of the query_cache_size variable in MySQL? The MySQL query cache is an in memory cache that stores the complete result sets of frequent SELECT queries. Instead of issuing the query again to the database engine, MySQL retrieves the result set from the cache and returns that to [...]

{ 2 comments }