Sunday, August 14, 2011

Logging queries in mysql

At times when debugging ORMs lke hibernate we may need to know what queries are actually hitting the db. MySql gives an easy way to do this. Add the below in the my.cnf file

  1. log=/var/log/mysql/general.log
  2. place the above in the section [mysqld] and
  3. restart the mysql: /etc/init.d/mysqld restart;

No comments:

Post a Comment