MySQL Primer--the Usage of Mysqladmin--ping,status,processlist,kill,shutdown
来源:互联网 发布:易语言网页数据采集 编辑:程序博客网 时间:2024/06/06 08:27
1.Using mysqladmin
*Checking MySQL server status
command:
mysqladmin -p ping;
mysqladmin -p status;
[sudo] password for fish:
Enter password:
mysqld is alive
eg2:
fish@piniheaven:~$ sudo mysqladmin -p status
Enter password:
Uptime: 3272 Threads: 1 Questions: 111 Slow queries: 0 Opens: 175 Flush tables: 1 Open tables: 42 Queries per second avg: 0.033
*find out what connections are active to the MySQL server
command:
mysqladmin -p processlist;
Enter password:
+----+------+-----------+------------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------------+---------+------+-------+------------------+
| 46 | root | localhost | MyDatabase | Sleep | 100 | | |
| 50 | root | localhost | | Query | 0 | | show processlist |
+----+------+-----------+------------+---------+------+-------+------------------+
explanation:
From above, we can see a user named root is connected from localhost to the MyDatabase database
*kill a connection
command:
mysqladmin kill <id>
Enter password:
fish@piniheaven:~$ sudo mysqladmin -p processlist
Enter password:
+----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+----+---------+------+-------+------------------+
| 52 | root | localhost | | Query | 0 | | show processlist |
+----+------+-----------+----+---------+------+-------+------------------+
explanation:
after executing the command,we can see that the connection by id 46 no longer exists:
At the sametime,when the root user with an id 46 who connected via the MySQL CLI try to do someting,for example:
SHOW DATABASES;Unfortunately,it didn't work!He would received the following messages:
ERROR 2006 (HY000): MySQL server has gone awayNo connection. Trying to reconnect...
*shoutdown the server
command:
mysqladmin -p shutdown
*Checking MySQL server status
command:
mysqladmin -p ping;
mysqladmin -p status;
eg1:
fish@piniheaven:~$sudo mysqladmin -p ping[sudo] password for fish:
Enter password:
mysqld is alive
eg2:
fish@piniheaven:~$ sudo mysqladmin -p status
Enter password:
Uptime: 3272 Threads: 1 Questions: 111 Slow queries: 0 Opens: 175 Flush tables: 1 Open tables: 42 Queries per second avg: 0.033
*find out what connections are active to the MySQL server
command:
mysqladmin -p processlist;
eg3:
fish@piniheaven:~$ sudo mysqladmin -p processlistEnter password:
+----+------+-----------+------------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------------+---------+------+-------+------------------+
| 46 | root | localhost | MyDatabase | Sleep | 100 | | |
| 50 | root | localhost | | Query | 0 | | show processlist |
+----+------+-----------+------------+---------+------+-------+------------------+
explanation:
From above, we can see a user named root is connected from localhost to the MyDatabase database
*kill a connection
command:
mysqladmin kill <id>
eg4:
fish@piniheaven:~$sudo mysqladmin -p kill 46Enter password:
fish@piniheaven:~$ sudo mysqladmin -p processlist
Enter password:
+----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+----+---------+------+-------+------------------+
| 52 | root | localhost | | Query | 0 | | show processlist |
+----+------+-----------+----+---------+------+-------+------------------+
explanation:
after executing the command,we can see that the connection by id 46 no longer exists:
At the sametime,when the root user with an id 46 who connected via the MySQL CLI try to do someting,for example:
SHOW DATABASES;Unfortunately,it didn't work!He would received the following messages:
ERROR 2006 (HY000): MySQL server has gone awayNo connection. Trying to reconnect...
*shoutdown the server
command:
mysqladmin -p shutdown
- MySQL Primer--the Usage of Mysqladmin--ping,status,processlist,kill,shutdown
- 用mysqladmin -i10 processlist extended-status监控MySQL的状态。
- 批量kill mysql processlist进程
- MySQL show processlist 中status
- Mysql进程查看 show processlist(kill ID)
- 批量kill mysql processlist进程
- The usage of finalize()
- usage of the serialVersionUID
- the usage of lucene
- The usage of SQLPATH
- the usage of sscanf()
- the usage of vim
- The usage of #pragma
- The usage of InjectView
- 13 usage of mysql
- 自动kill掉超时的mysql show processlist进程
- Usage of the vc timer
- The Usage of map::insert
- C++-----------STL经典网址
- WCF 项目应用连载[1] - 索引 - 轻量级的Log系统 - Lig Sample -序
- SQL语句之WHERE查询子句
- UNIX环境高级编程——进程间通讯方法整理
- Eclipse Invalid location of tag 解决办法分析
- MySQL Primer--the Usage of Mysqladmin--ping,status,processlist,kill,shutdown
- 黑马程序员——集合(上)
- ZOJ 1406 Jungle Roads
- 负数在计算机中的保存
- wpf XMAL中隐藏控件
- Practical Common Lisp学习笔记——之第5章函数
- C语言野指针
- xml CDATE区
- there is no Action mapped for namespace / and action name 解决方法