mysql开启常规日志,会记录日常的数据库操作,数据量会非常大,所有要做好日志分割和日志清理删除的工作,
vim /etc/my.cnf
[mysqld]
log=/usr/local/mysql/log/date.log
log-output=FILE
重启数据库
- [root@clinet2 log]# cat date.log
- /usr/local/mysql/libexec/mysqld, Version: 5.1.60-log (Source distribution). started with:
- Tcp port: 3306 Unix socket: /tmp/mysql.sock
- Time Id Command Argument
- 130326 14:33:55 1 Connect root@localhost on
- 1 Query select @@version_comment limit 1
- 130326 14:33:58 1 Query ls
- use
- 130326 14:34:00 1 Query SELECT DATABASE()
- 1 Init DB food
- 130326 14:34:07 1 Query select * from person