MySQL should be compiled with debug on option to enable trace file generation. Issue mysqld -V command to find out if it shall been compiled with debug option. If the version number ends with -debug,then the binary is compiled with support for trace files.
The default way of generating the trace files is to invoke mysqld as under:
- mysqld --debug.
- mysqld --debug=d,info,error,query,general,where :o,/tmp/mysqld.trace
For more info refer to the following URL:
- http://www.tol.it/doc/MySQL/appendixC.html
- http://dev.mysql.com/doc/refman/5.1/de/the-dbug-package.html