mysql日誌的使用命令

2021-12-30 11:05:31 字數 793 閱讀 5171

mysql日誌的使用命令

mysql有以下幾種日誌: 

錯誤日誌: -log-err 

查詢日誌: -log 

慢查詢日誌: -log-slow-queries 

更新日誌: -log-update 

二進位制日誌: -log-bin 

在mysql的安裝目錄下,開啟my.ini,在後面加上上面的引數,儲存後重啟mysql服務就行了。 

例如: 

#enter a name for the binary log. otherwise a default name will be used. 

#log-bin= 

#enter a name for the query log file. otherwise a default name will be used. 

#log= 

#enter a name for the error log file. otherwise a default name will be used. 

log-error= 

#enter a name for the update log file. otherwise a default name will be used. 

#log-update= 

上面只開啟了錯誤日誌,要開其他的日誌就把前面的「#」去掉 

檢視命令: 

①show variables like 'log_%';檢視所有的log命令 

②show variables like 'log_bin';檢視具體的log命令

mysql使用命令

1.建立使用者 create user name host identified by psssword 2.授權 grant select,updata,insert all on database.table to username host 3.查詢許可權 show grants for us...

mysql日誌問題定位實用命令

show engine innodb status檢視日誌 select version 檢視版本 不同版本效能優化不同 select from information schema.innodb trx 檢視當前的事務狀態 select tx isolation 檢視當前會話隔離級別 select...

MySQL的基本使用命令

常見的命令 登入資料庫 mysql uroot p3306 root為使用者名稱 3306為使用者密碼 退出資料庫 exit 檢視所有資料庫 show databases 建立資料庫 create databases test test為新建立的資料庫名 切換到某個資料庫 use test 建立資料...