views:

2880

answers:

9

"Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for monitoring an instance of the Database Engine or Analysis Services."

I find using SQL Server Profiler extremely useful during development, testing and when I am debugging database application problems. Does anybody know if there is an equivalent program for MySql?

A: 

I don't know about any profiling apps as such, but it's commonplace to use the EXPLAIN syntax for analysing queries. You can use these to figure out the best indexes to create, or you can try changing the overall query and see how it changes the efficiency, etc.

mercutio
+10  A: 

Something cool that is in version 5.0.37 of the community server is MySQL's new profiler.

This may give you what info you are looking for.

Buggabill
+1  A: 

If version 5.0.37 isn't available, you might want to look at mytop. It simply outputs the current status of the server, but allows you to run EXPLAIN as (mentioned by mercutio) on particular queries.

Dave Marshall
+1  A: 

Are you wanting to monitor performance, or just see which queries are executing? If the latter, you can configure MySQL to log all queries it's given. On a RedHat Linux box, you might add

log = /var/lib/mysql/query.log

to the [mysqld] section of /etc/my.cnf before restarting MySQL.

Remember that in a busy database scenario, those logs can grow quite large.

Jon Topper
A: 
nmiranda
+5  A: 

You can also try Jet Profiler for MySQL, graphical query profiling tool:

A: 

Theres something thats is the next best thing for you looking for, and its free.

Its called the profiler :

Actively queries data at a given interval and lets you know of data changes that occur over time. Interactive reports, email notifications, generates scripts to mimick operations that happen on the data across any given timespan. Free for one year

Itamar
A: 

None of these seem to work. Either the demo does not allow the capability to monitor queries as with the Jet Profiler. Or, as in the case of the Nob hill profiler, crashes on any kind of connection. Or, in the case of logmonitor, never does anything? Just sits there using all kinds of CPU... forever... and ever.

TGF
+1  A: 

Jet Profiler is good if it's a paid version. The LogMonitor just point it to the mysql log file.

Ivan