Linux system boot MySQL log
The following configuration is placed under [mysqld]
The code is as follows |
Copy Code |
#查询日志 Log=/var/log/mysql_query.log #慢查询日志 Long_query_time = n the upper limit for execution of slow queries (the default setting is 10s). Log-slow-queries=/var/log/mysql_slowquery.log
#更新日志 Server-id = 1 Log-bin = Binlog Log-bin-index = Binlog.index
|
windows enable MySQL logging is attached below
The following is the entire process of configuration
Edit My.ini, find the [Msqld] section, and add the following command
The code is as follows |
Copy Code |
[MySQL] Log= "E:/mysqllog/mysql.log" |
Restart MySQL
The code is as follows |
Copy Code |
Mysql> Show variables like "log%"; +---------------------------------+----------------+ | variable_name | Value | +---------------------------------+----------------+ | Log | On | | Log_bin | On | | log_bin_trust_function_creators | Off | | Log_error |./ts17-113.err | | Log_slave_updates | Off | | log_slow_queries | Off | | log_warnings | 1 | +---------------------------------+----------------+ |
Log here can see that the logs are enabled.
Open E:/mysqllog/mysql.log and see the command you just used
Mysql.log file
The code is as follows |
Copy Code |
D:/program files/mysql/mysql Server 5.0/bin/mysqld-nt, Version:5.0.22-community-nt-log. Started with: TCP port:3306, Named Pipe: (NULL) Time Id Command Argument 110704 15:57:39 1 Connect root@localhost on KBQ 1 Query show variables like "log%" 110704 15:58:52 1 Query SELECT DATABASE () 110704 15:58:57 1 Query select * FROM Test 110704 15:58:59 1 Query Show tables |