Don’t leave your MySQL hanging (check your my.cnf)


2380021517_b526fbfc98_mAdmit it! Have you ever made a change to your my.cnf file, restarted mysqld only to have the restart fail because of an error in the configuration file? Come on, you don’t have to hide anything here.

Well, I found my new best friend when performance tuning mysql. Thanks to this simple post, we can now check the syntax of out “tweaked” my.cnf file BEFORE restarting mysqld.

Yup. All your mysql experts are saying, “Duh!”. Well, for me this was well worth the 15 seconds to find with Google.

Use the mysqld shell command with the –help and –verbose flags. If there is an error in your my.cnf file, it will tell you as in the example below. For those who don’t want to learn more, if your my.cnf is syntactically correct, you will get the long config settings list displayed.

# /usr/libexec/mysqld --help --verbose
081009 9:55:36 [ERROR] /usr/libexec/mysqld: unknown variable 'mmax_connections=150'

Once your done, you can quickly restart mysqld. Hopefully, nobody even notices. :o )

Popularity: 2% [?]

About Tom

Christ follower, husband, father, technology and photography enthusiast. Attempting to live life out as a light in this world and stumbling at times in this fallen world. Got a topic you want to have me look into? Did I miss something in a post? Let me know. Just add a comment below.