List of Useful MySQL Commands
Here is a list of some important queries that I have had to use with MySQL. Some of these are very helpful, others are plain invaluable.
View all the queries/threads/process that are running:
SHOW PROCESSLIST;
Kill a certain query that is long running:
Count the number of unique records given a column name:Bring up the the processlist by using the SHOW PROCESSLIST; command, then
KILL <thread_id>;
SELECT COUNT(DISTINCT column_name) FROM table_name;
Introduction to stored procedures
When you need to really got a big job done, and just a simple is limiting you...
Gilfster: MySQL 5.0 Stored Procedures
Implementing Cursors - Sequential step through of a given recordset:
Unfortunately, there is no one liner that will do it. But below are some links to get started.
Difference between a Where clause and a Having clause - when using Group By
This site, has a great explaination with example queries and results.


