| 26533 | moodleuser | zahra.learningmysql.com:63593| Moodle |...
| 26534 | root | localhost | |...
+-------+------------+-----------------------------+--------+...
... +---------+------+-------+------------------+
... | Command | Time | State | Info |
... +---------+------+-------+------------------+
... | Sleep | 1 | | |
... | Query | 0 | | show processlist |
... +You can end a problematic process using the
KILL
command with the number of the process. If you somehow
kill your own connection, the monitor will establish anew connection to the server, resulting in anew process number. Here, we kill our own (the root users) connection — see how the new process number (26535) is different?:
mysql>
KILL 26534;Query OK, 0 rows affected (0.02 sec)
mysql>
SHOW PROCESSLIST;ERROR 2006 (HY000):
MySQL server has gone awayNo connection. Trying to reconnect...
Connection id Current database *** NONE ***
+-------+------------+-----------------------------+--------+...
| Id | User | Host | db |...
+-------+------------+-----------------------------+--------+...
| 26533 | moodleuser | zahra.learningmysql.com:63593| Moodle |...
| 26535 | root | localhost | |...
+-------+------------+-----------------------------+--------+...
... +---------+------+-------+------------------+
... | Command | Time | State | Info |
... +---------+------+-------+------------------+
... | Sleep | 1 | | |
... | Query | 0 | | show processlist |
... +---------+------+-------+------------------+
2 rows inset sec)
The mysqladmin kill command does the same thing
mysqladmin --user=root --password=the_mysql_root_password kill 26534Other Things to ConsiderThere are many other aspects of database and application design that you can look at when considering performance. For example, if you make
large-scale changes to a table(for example, by deleting many entries, you are likely to get better performance
if you run the OPTIMIZE TABLEcommand to reorganize the table file on disk. This is especially true if the table contains variable length fields:
mysql>
OPTIMIZE TABLE artist;+--------------+----------+----------+----------+
| Table | Op | Msg_type | Msg_text |
Share with your friends: