The following article mainly describes the MySQL operation log to see the actual operation steps and the actual operation steps of the specific description, if you encounter similar situation in the actual operation, but you do not know how to solve it correctly, then the following article for you must be a mentor.
Just contact with MySQL soon, found that the lack of more enterprise-class features, want real-time view of MySQL executed SQL statements, similar to the event Profiler in MSSQL, Internet search, can only perform operations written to the log, the practice is as follows:
Set the My.ini file, my MySQL installation environment is XP SP2, the file in C:\windows\. , open the file to modify
[MySQLd]
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
Long_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