Databases Reference
In-Depth Information
| 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 a new
connection to the server, resulting in a new process number. Here, we kill our own (the
root user's) 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 away
No connection. Trying to reconnect...
Connection id: 26535
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 in set (0.00 sec)
The mysqladmin kill command does the same thing:
$ mysqladmin --user=root --password= the_mysql_root_password kill 26534
Other Things to Consider
There 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 TABLE command 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 |
 
Search WWH ::




Custom Search