MySQL 5.6開啟全查詢日誌時注意事項

來源:互聯網
上載者:User

MySQL 5.6開啟全查詢日誌時注意事項

今天因為要查詢一個SQL語句的調用的地方,在生產上開啟了全查詢日誌,一直還以為在my.cnf只要這樣寫即可:

log=/home/logs/mysql.log

但重啟時發現報Starting MySQL. ERROR! The server quit without updating PID file (/home/data/mysql//localhost.localdomain.pid)錯誤

開始還以為是許可權的問題,把/home/logs/mysql.log許可權修改後還是不行,果斷注釋剛加的代碼,能正常啟動mysql。

到網上查了下,發現   這上面的情況與我遇到的一樣,按照這上面的再配置了下,即在my.cnf中的[mysqld]中添加了以下兩行代碼:

general_log=ON

general_log_file=/home/logs/mysql.log

儲存後重啟發現能正常啟動,並能正常記錄全部的查詢日誌與更新日誌。

本文永久更新連結地址:

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.