Mysql全域性變數含義

2021-10-06 12:30:02 字數 1129 閱讀 3854

5.常用運維命令

6.mysql鎖定狀態檢視相關命令 [原文](

show global variables;

show global variables like 『%***%』;

方式一:set global 變數名=值;

方式二:/etc/my.cnf [mysqld]段中 變數名=值 需重啟mysql後生效

有些變數set後直接生效,有些則需重啟mysql生效

mysql客戶端在嘗試與mysql伺服器建立連線時,mysql伺服器返回錯誤握手協議前等待客戶端資料報的最大時限。

預設值:10秒。

mysql客戶端的資料庫連線閒置最大時間值。

預設值:8小時 。

sql語句日誌

general_log 是否記錄日誌

general_log_file 日誌檔案存放目錄及檔名

在配置檔案/etc/my.cnf中 設定mysqld執行時的錯誤日誌存放目錄

log_error=/var/log/mysqld.log

慢查詢日誌記錄

slow_query_log 是否開啟

slow_launch_time 慢時間閥值 單位:秒

slow_query_log_file 慢查詢日誌檔案

log_timestamps=system 使用當前作業系統設定的時區

show processlist; 檢視當前使用者會話

kill id; 殺死會話

show status; 檢視系統變數值,狀態值。

注意:如果配置檔案/etc/my.cnf中,有錯誤的引數名稱則會造成 mysqld不能正常啟動。

show open tables; 顯示被開啟的表

show status like 『%lock%』 ; 顯示鎖的狀態

select * from information_schema.innodb_trx;

查詢 正在執行的事務

select * from information_schema.innodb_locks;

檢視正在鎖的事務

select * from information_schema.innodb_lock_waits;

檢視等待鎖的事務

nginx內建全域性變數及含義

名稱 版本 說明 變數列表 於檔案 ngx http variables args 1.0.8 請求中的引數 binary remote addr 1.0.8 遠端位址的二進位制表示 body bytes sent 1.0.8 已傳送的訊息體位元組數 content length 1.0.8 htt...

nginx內建全域性變數及含義

名稱 版本 說明 變數列表 於檔案 ngx http variables args 1.0.8 請求中的引數 binary remote addr 1.0.8 遠端位址的二進位制表示 body bytes sent 1.0.8 已傳送的訊息體位元組數 content length 1.0.8 htt...

nginx內建全域性變數及含義

名稱 版本 說明 變數列表 於檔案 ngx http variables args 1.0.8 請求中的引數 binary remote addr 1.0.8 遠端位址的二進位制表示 body bytes sent 1.0.8 已傳送的訊息體位元組數 content length 1.0.8 htt...