View the statements that are executed by MySQL
want to see real-time SQL statements executed by MySQL, similar to the profiler in MSSQL. Set the My.ini file to open the file for modification:
Basedir=e:/mysql 4.0.12
#bind-address=192.168.15.196
datadir=e:/mysql 4.0.12/data
#language =e:/mysql 4.0.12/share/your language directory
#slow query log#=slowqueris.log
#tmpdir #=
#port =3306
# set-variable=key_buffer=16m
Ong_query_time = 1--refers to the execution of more than how long SQL will be log down, here is 1 seconds
Log-slow-queries=slowqueris.log--Log the query back to a slower statement
Log-queries-not-using-indexes = nouseindex.log--literally, log down. Query with no index
Log=mylog.log--Record all execution statements
When the above parameters are turned on, the MySQL performance may be affected, and the recommended shutdown in the production environment
How to use the new update log
If you use only one update log, you only need to clear the log file, then move the old update log file to a backup, and then enable the new update log.
You can force the server to enable a new update log in the following ways:
You typically need to provide a database user to use at the command line:
Mysqladmin–u root–p flush-logs
mysqladmin Refresh
You typically need to provide a database user to use at the command line:
Mysqladmin–u root–p Refresh
If you are using a MySQL 3.21 or earlier version, you must use Mysqladmin refresh.
SQL command
Reboot the server
All of the above methods have this functionality:
Closes and then opens the standard and update record files. If you specify an update record file without an extension, the extension number of the new update record file will be added to the previous file by 1.
How to use the new regular log
You can also force updates to the regular log by using the above method.
To prepare to back up a regular log, the steps may be more complex:
$ CD mysql-data-directory
$ mv mysql.log mysql.old
$ mysqladmin flush-tables
Then make a backup and delete "Mysql.old".