A few interesting mySQL functions

You can see the process list, find out who is doing what and kill a process if needed.

If you log into PHPmyAdmin and enter the following into the SQL text box :

show processlist;

You will see a list of the processes.

If you are using the mysql command line environment then you can do it at the command line as well

mysql> show processlist;

Once you know the process ID you can then kill the process using the ID number as follows :

mysql>kill 349

Here are some further functions that may be of interest :

show status;

show table status like ‘%’;

The above gives you create time and other information.

All can be run from within PHPmyAdmin or from the mysql command line.

An INSERT INTO with other calculations

This mySQL “Insert from another table with select” example shows how you can concatenate two of the selected fields into one inserted field.

In this example we are inserting data into tbllistings using data from tblrawdata but we are doing other processing on fields before it is inserted.  Obviously you can use any of the other mySQL select string, arithmetic and mathematical operators and functions when you do your select statement and then insert those into the new table.

INSERT INTO tbllistings (
.. etc
concat(property_id, agent_id),
.. etc
FROM tblrawdata;