How to view the running/loaded config for MySQL

Posted May 31st, 2011 by bryanr

I had a heck of a time finding out how to see what the parameters were currently loaded for MySQL on our servers.  By default, when you install MySQL server from the Ubuntu repositories, the my.cnf config file specifies only a few variables.  And the rest just use a default value (my assumption).  We recently had a problem with one of our websites that was being bombarded with registration requests; the database became unresponsive because of the number of sleeping processes that used up all of the system memory.  Since MySQL uses a default wait_timeout value of 28800 (8hrs), the sleeping processes were allowed to eat up system resources.  There were no timeout parameters listed in the my.cnf file at all.  So, if a setting is not specified in your my.cnf file, how do you see what is loaded by default?  Just run the following command:

# mysqld –help
# mysqld –verbose –help

You will have to specify a user when you run the command.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>