tags:

views:

29

answers:

1
+1  Q: 

Log Mysql warnings

I'm trying to get Mysql to log all warnings to the log file. I'm running stored procedures, and I want to get at the warnings they generate.

+1  A: 

Assuming that you have administrator privilege then you need to change the server configuration. You can do this by using the MySQL server tools (workbench is the latest) or by editing the my.ini file directly.

remember to turn on general logging. Here's an entry for writing Errors to a logfile:

general-log
log-error = "C:\Program Files\MySQL\MySQL Server 5.1\logfiles\ErrorMessages.log"

edit

Ah. Here's an extract from my 5.0.51b server my.ini file

log-queries-not-using-indexes
log-warnings
long_query_time = 2
log = "C:\Program Files\MySQL\MySQL Server 5.0\logfiles\querylog.log"
log-slow-queries = "C:\Program Files\MySQL\MySQL Server 5.0\logfiles\SlowQueryLog.log"
log-error = "C:\Program Files\MySQL\MySQL Server 5.0\logfiles\ErrorLog.log"
ChrisBD
There's no such setting as "general-log". After I put it in my.cnf Mysql does not start.
mtrencseni
Ah, it's supposed to be "general-log = 1" and it's a 5.1.12+ feature. Unfortunately I'm on 5.0.x so I can't test it.
mtrencseni
I posted an update to show some lines from a 5.0.51b my.ini file.
ChrisBD