Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I use a statement set global general_log = 'ON' to enable the general_log on my computer.

After I restart or shutdown it, I have to run the statement again.

How can I config MySQL write general log without to run the statement again and again?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Add this to my.ini

[mysqld]
log

If you have a specfic place for the log, such as C:\mysql_general.log

[mysqld]
log=C:/mysql_general.log
log="C:\mysql_general.log"

It's one of those. I haven't done mysql in Windows in a while.

Then restart mysql

net start mysql

Give it a Try !!!

CAVEAT

Prior to MySQL 5.6, you can use log.

In MySQL 5.6, log is deprecated. Use general-log instead.

UPDATE 2011-12-09 22:18 EDT

If you do not have my.ini defined, then you must define one.

To keep things simple, just create my.ini in the folder where my-huge.ini, my-large.ini, my-medium.ini, and my-small.ini appear. Just open up notepad on my.ini in that folder.

Then add the lines I mentioned before:

[mysqld]
log

or

[mysqld]
log=C:/mysql_general.log
log="C:\mysql_general.log"

UPDATE 2011-12-09 22:26 EDT

In the worst case, try putting my.ini in C:\

share|improve this answer
    
Execuse me, but I have my-huge.ini, my-large.ini, my-medium.ini, my-small.ini. Which one is the approriate ini? I use xampp for php mysql and apache. –  eureka Dec 10 '11 at 3:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.