mysql 狀態鎖 連線數

2022-05-06 12:06:11 字數 2663 閱讀 1235

show open tables where in_use > 0;

show status like 'table%';

select * from information_schema.innodb_trx;

select * from information_schema.innodb_locks;

select * from information_schema.innodb_lock_waits;

show status like 'threads%';#開啟的連線數 #啟用的連線數 一般遠低於connected數值

#這是是查詢資料庫當前設定的最大連線數

show variables like '%max_connections%';

#連線情況

show variables like '%connect%';

#檢視伺服器響應的最大連線數

show global status like 'max_used_connections';

show status like '%max_connections%'; ##mysql最大連線數 set global max_connections=1000 重新設定

show global status like 'max_used_connections'; ##伺服器響應的最大連線數

show status like 'threads%';

#variable_name value

#threads_cached 0 ##mysql管理的執行緒池中還有多少可以被復用的資源

#threads_connected 152 ##開啟的連線數

#threads_created 550 ##表示建立過的執行緒數,如果發現threads_created值過大的話,表明mysql伺服器一直在建立執行緒,這也是比較耗資源,可以適當增加配置檔案中thread_cache_size值, 查詢伺服器

show variables like 'thread_cache_size';

#set global thread_cache_size=60;

#threads_running 1 ##啟用的連線數,這個數值一般遠低於connected數值,準確的來說,threads_running是代表當前併發數

show processlist;

show status like '%connections%';

show status like '%aborted_clients%';

show status like '%aborted_connects%';

#aborted_clients 由於客戶沒有正確關閉連線已經死掉,已經放棄的連線數量。

#aborted_connects 嘗試已經失敗的mysql伺服器的連線的次數。

#connections 試圖連線mysql伺服器的次數。

#created_tmp_tables 當執行語句時,已經被創造了的隱含臨時表的數量。

#delayed_insert_threads 正在使用的延遲插入處理器執行緒的數量。

#delayed_writes 用insert delayed寫入的行數。

#delayed_errors 用insert delayed寫入的發生某些錯誤(可能重複鍵值)的行數。

#flush_commands 執行flush命令的次數。

#handler_delete 請求從一張表中刪除行的次數。

#handler_read_first 請求讀入表中第一行的次數。

#handler_read_key 請求數字基於鍵讀行。

#handler_read_next 請求讀入基於乙個鍵的一行的次數。

#handler_read_rnd 請求讀入基於乙個固定位置的一行的次數。

#handler_update 請求更新表中一行的次數。

#handler_write 請求向表中插入一行的次數。

#key_blocks_used 用於關鍵字快取的塊的數量。

#key_read_requests 請求從快取讀入乙個鍵值的次數。

#key_reads 從磁碟物理讀入乙個鍵值的次數。

#key_write_requests 請求將乙個關鍵字塊寫入快取次數。

#key_writes 將乙個鍵值塊物理寫入磁碟的次數。

#max_used_connections 同時使用的連線的最大數目。

#not_flushed_key_blocks 在鍵快取中已經改變但是還沒被清空到磁碟上的鍵塊。

#not_flushed_delayed_rows 在insert delay佇列中等待寫入的行的數量。

#open_tables 開啟表的數量。

#open_files 開啟檔案的數量。

#open_streams 開啟流的數量(主要用於日誌記載)

#opened_tables 已經開啟的表的數量。

#questions 發往伺服器的查詢的數量。

#slow_queries 要花超過long_query_time時間的查詢數量。

#threads_connected 當前開啟的連線的數量。

#threads_running 不在睡眠的執行緒數量。

#uptime 伺服器工作了多少秒

Mysql 檢視連線數,狀態

命令 show processlist 如果是root帳號,你能看到所有使用者的當前連線。如果是其它普通帳號,只能看到自己占用的連線。show processlist 只列出前100條,如果想全列出請使用show full processlist mysql show processlist 命令 ...

Mysql 檢視連線數,狀態

如果是root帳號,你能看到所有使用者的當前連線。如果是其它普通帳號,只能看到自己占用的連線。show processlist 只列出前100條,如果想全列出請使用show full processlist mysql show processlist 命令 show status like 下面變...

Mysql 檢視連線數,狀態

命令 show processlist 如果是root帳號,你能看到所有使用者的當前連線。如果是其它普通帳號,只能看到自己占用的連線。show processlist 只列出前100條,如果想全列出請使用show full processlist mysql show processlist 命令 ...