tags:

views:

88

answers:

4

How do I profile a MySQL database. I want to see all the SQL being run against a database.

I know you can do this:

  • type set profiling=1;
  • Run your slow query (eg SELECT * FROM messages WHERE fromaddress='xxx';)
  • type SHOW PROFILES;

But this seem to only apply to stuff run on the command line, I want to see the results from running a website.

+1  A: 

You can simply parse the query log in real time. If on linux, you can use tail -f to see the log live

Also, you can try some free software from these guys:

http://hackmysql.com/mysqlsla

Bryan Migliorisi
A: 

there is a product that cost money

http://www.webyog.com/en/

Haim Evgi
+1  A: 

You want the query log - but obviously doing this on a heavy production server could be... unwise.

Tom Ritter
A: 

MySqlAdministrator have some useful build in features (including logs view), but for logs it have to be run on same machine as database

buddy