[摘要]+---------------+---------------修改错误日志的地址可以在/etc/my.cnf中添加--log-error = [filename]来开启mysql错误日志。我的是:...
+---------------+---------------
修改错误日志的地址可以在/etc/my.cnf中添加--log-error = [filename]来开启mysql错误日志。我的是:
log_error = /tmp/mysql.log
先来查看一下:tail -f /tmp/mysql.log
bash-3.2# tail -f /tmp/mysql.log
2015-12-23T02:22:41.467311Z 0 [Note] IPv6 is available.
2015-12-23T02:22:41.467324Z 0 [Note] - '::' resolves to '::';
2015-12-23T02:22:41.467350Z 0 [Note] Server socket created on IP: '::'.
2015-12-23T02:22:41.584287Z 0 [Note] Event Scheduler: Loaded 0 events
2015-12-23T02:22:41.584390Z 0 [Note] /usr/local/Cellar/mysql/5.7.9/bin/mysqld: ready for connections.
Version: '5.7.9' socket: '/tmp/mysql.sock' port: 3306 Homebrew
2015-12-23T02:22:42.540786Z 0 [Note] InnoDB: Buffer pool(s) load completed at 151223 10:22:42
151223 10:22:51 mysqld_safe A mysqld process already exists
2015-12-23T02:25:30.984395Z 2 [ERROR] Could not use /tmp/mysql_query.log for logging (error 13 - Permission denied). Turning logging off for the server process. To turn it on again: fix the cause, then either restart the query logging by using "SET GLOBAL GENERAL_LOG=ON" or restart the MySQL server.
2015-12-23T07:28:03.923562Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 61473ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
信息量比较大,暂不分析了。。。。当然 如果mysql配置或连接出错时, 仍然可以通过tail -f 来跟踪日志的
二、General Query Log
记录mysql的日常日志,包括查询、修改、更新等的每条sql。
关键词:详细介绍Mysql中的4种日志