Is there a Profiler equivalent for MySql?

MysqlSql ServerDatabase

Mysql Problem Overview


"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?

Mysql Solutions


Solution 1 - Mysql

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.

Solution 2 - Mysql

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.

Solution 3 - Mysql

Try JET profiler is a real-time query performance and diagnostics tool! I use it in my work. Excellent software and support. Review Jet Profiler for MySQL

Solution 4 - Mysql

Using Neor Profiler SQL, is excellent! and the application is free for all users. https://www.profilesql.com/download/ image of query flow

Solution 5 - Mysql

In my opinion I've found everything here in raw....

Find and open your MySQL configuration file, usually /etc/mysql/my.cnf on Ubuntu. Look for the section that says “Logging and Replication”

# * Logging and Replication
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.

log = /var/log/mysql/mysql.log

or in newer versions of mysql, comment OUT this lines of codes

general_log_file        = /var/log/mysql/mysql.log
general_log             = 1
log_error                = /var/log/mysql/error.log

Just uncomment the “log” variable to turn on logging. Restart MySQL with this command: sudo /etc/init.d/mysql restart

Now we’re ready to start monitoring the queries as they come in. Open up a new terminal and run this command to scroll the log file, adjusting the path if necessary.

tail -f /var/log/mysql/mysql.log

Solution 6 - Mysql

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

Solution 7 - Mysql

Not sure about graphical user interface but there is a command that has helped me profile stored procedures a lot in MySQL using workbench:

SET profiling = 1;
call your_procedure;
SHOW PROFILES;
SET profiling = 0;

Solution 8 - Mysql

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.

Solution 9 - Mysql

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAndrew RimmerView Question on Stackoverflow
Solution 1 - MysqlBuggabillView Answer on Stackoverflow
Solution 2 - MysqlJon TopperView Answer on Stackoverflow
Solution 3 - MysqlDevid GView Answer on Stackoverflow
Solution 4 - MysqlVictor GradosView Answer on Stackoverflow
Solution 5 - MysqlMatijaView Answer on Stackoverflow
Solution 6 - MysqlIvanView Answer on Stackoverflow
Solution 7 - MysqlMauricio AloView Answer on Stackoverflow
Solution 8 - MysqlDave MarshallView Answer on Stackoverflow
Solution 9 - MysqlmercutioView Answer on Stackoverflow