design. business. life.

Information

This article was written on 09 Oct 2009, and is filled under Web Development.

Current post is tagged

, , ,

More SSH/Command Line MySQL commands

I noticed that my previous post with basic MySQL SSH commands was relatively popular and I’ve been meaning to save some of the recent ones I’ve been using before I forget them, so…

show full processlist;

This shows all the processes (queries) running on the server at the moment you run it. Helpful if the server is running slow to see which queries might be causing the slowness.

show status like ‘qcache%’;

This shows several variables related to your MySQL query cache (see below). Important to note are the following:

  • Qcache_free_memory – how much memory you have available for caching
  • Qcache_inserts - if this number is larger than your Qcache_hits, it probably means your MySQL acche is not being used properly
+————————-+———+
| Variable_name           | Value   |
+————————-+———+
| Qcache_free_blocks      | 798     |
| Qcache_free_memory      | 4161824 |
| Qcache_hits             | 9260760 |
| Qcache_inserts          | 4366152 |
| Qcache_lowmem_prunes    | 595048  |
| Qcache_not_cached       | 304800  |
| Qcache_queries_in_cache | 7729    |
| Qcache_total_blocks     | 40040   |
+————————-+———+

+————————————-+———+
| Variable_name                        | Value   |
+————————————-+———+
| Qcache_free_blocks              | 798     |
| Qcache_free_memory           | 4161824 |
| Qcache_hits                            | 9260760 |
| Qcache_inserts                      | 4366152 |
| Qcache_lowmem_prunes    | 595048  |
| Qcache_not_cached              | 304800  |
| Qcache_queries_in_cache  | 7729    |
| Qcache_total_blocks             | 40040   |
+————————————-+———+

Hope that helps someone.

Leave a Reply