MYSQL监控命令
一.性能監控
1.查看正在執行的進程
show processlist;2.查看當前最大連接數
show variables like 'max_connections';3.設置mysql 最大連接數(默認151 可以調大到512)
set global max_connections=1024;4. 查看試圖連接到MySQL
show status like 'connections';5. 查看線程緩存內的線程的數量
show status like 'threads_cached';?6.查看當前打開的連接的數量
show status like 'threads_connected';7.查看創建用來處理連接的線程數
show status like 'threads_created';8.查看激活的(非睡眠狀態)線程數
show status like 'threads_running';9.查看立即獲得的表的鎖的次數
show status like 'table_locks_immediate';10.查看不能立即獲得的表的鎖的次數。
如果該值較高,并且有性能問題,你應首先優化查詢,然后拆分表或使用復制。
show status like 'table_locks_waited';11.分析mysql表鎖定
show status like 'Table%';12.查詢正在鎖定的表
show OPEN TABLES where In_use > 0;13.MySQL中show engine innodb status的詳解
SHOW ENGINE INNODB STATUS;總結
- 上一篇: phpcms配置邮箱的方法
- 下一篇: MySQL数据库自动添加时间戳