Mysql logs include error logs, query logs, slow query logs, update logs and binary logs. View method. In windows, you must
Mysql logs include error logs, query logs, slow query logs, update logs and binary logs. View method. In windows, you must
A bug occurred in the test. I checked the logs printed by the application and found that the data of the previous day was correct, and the data of the next day was incorrect, the only possibility is that someone directly updates the database during this period. Under normal circumstances, each database update requires the program to send some statistics to another department, result an exception occurred when the program sent the data the next day. I suspect that someone directly updates the database using the update statement. This is based on reasoning, but there is not enough evidence, because mysql does not enable the log function. This problem cannot be reproduced. It is very difficult to find a BUG in the application. Add the log update function to mysql! In Baidu, mysql logs are divided into error logs, query logs, slow query logs, update logs and binary logs. In windows, you need to modify the mysql installation directory to my. INI file. in linux, You need to modify etc/my. cnf file, find my. the cnf file is opened in vi. There is a log-update commented in it, add a line below it, configure the path for it, and save it. Then run two commands in the bin directory of the installation directory of mysql to restart mysql. My mysql is installed in the source file, if rpm is used for installation, the restart command is corresponding to Baidu.
# Mysqladmin-u root-p shutdown and enter the mysql password
# Mysqld_safe -- user = root & then run an update statement to check if there are any log files in the path.
The command for viewing log files is
Mysqlbinlog update.000001