請寫出mysql的日誌文件,並介紹日誌文件的作用。

在mysql中有五種日誌分別是:

1.錯誤日誌 (errorlog)

    mysql服務運行的錯誤,不是查詢sql運行產生的錯誤。

    1.1 查找錯誤日誌的信息

show variables like '%log_error%';

2.事務日誌

    事務日誌在innodb引擎下存在

    2.1.重做日誌(redo log)

    ib_logfile0

    2.2 回滾日誌(undo log)

    ibdata

3.二進制日誌(binlog)

show VARIABLES like '%log_bin%';

4.慢查詢日誌(slow query log)

    記錄sql查詢過程中比較慢的sql語句,在配置文件中添加這個配置

show VARIABLES like '%slow%';
slow_query_log=1
slow_query_log_file=/www/server/data/mysql-slow.log
slow_launch_time=3

 

5.查詢日誌(general log)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章