Learning Mysql



Download 4.24 Mb.
View original pdf
Page355/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   351   352   353   354   355   356   357   358   ...   366
Learning MySQL
390 | Chapter 12:
Configuring and Tuning the Server


| 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 away
No 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 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 |

Download 4.24 Mb.

Share with your friends:
1   ...   351   352   353   354   355   356   357   358   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page