Logging with MySQL

Steps to create MySQL log.

1. Open my.ini file. My file stored in C:\xampp\mysql\bin\my.ini

2. Find [mysqld]

3. Write at the last line under [mysqld]

general_log = 1
slow_query_log = 1
general_log_file = “C:/xampp/mysql/query.log”
log_slow_queries = “C:/xampp/mysql/queryslow.log”

General log file is create all log of your mysql.

Slow log file is create slow query of your mysql. By default time of slow is 10 seconds.

The path is an optional depend on where you want save the log file.

4. Restart mysql

5. Do something on your browser, for example : localhost/{your folder}

6. Open file query.log, see your my sql log.

Hope it help :)

 

 

No comments yet.

Leave a Reply

Keriput adalah garis-garis kebijaksanaan :-)