February 12, 2008

How to check MySQL Config files

Posted by peter

Probably most of MySQL users sometime had a situation when they would do changes in MySQL config file without restarting server (may be matching SET GLOBAL command to do it in run time) but either because option is misspelled or because given version does not support such option the server when would refuse to start when it restarted, either on operating system restart or recovering from MySQL Server crash. In any case it is quite nasty.

Unlike Apache MySQL service control script does not have "configtest" option so there is no straight way to check MySQL config file for errors. However you can do it by running mysqld --help option:

CODE:
  1. [root@sl1 tmp]# /usr/libexec/mysqld --help
  2. 080212 12:39:30 [ERROR] /usr/libexec/mysqld: unknown variable 'myis_test=1'

This does not do complete check, ie it is possible to allocate 80GB to buffer pool instead of 8G you intended but at least it checks options for names which is good sanity check.

I would encourage you to run such check after you made changes to your config file for sanity purposes.

Related posts: :Can you Trust CHECK TABLE ?::Lighttpd as reverse proxy::TMP_TABLE_SIZE and MAX_HEAP_TABLE_SIZE:
 

4 Comments »

  1. 1. walrus

    I believe the proper way is to submit a feature request on bugs.mysql.com and ask them to add special options, say, –check_config to mysqld

    Comment :: February 14, 2008 @ 6:28 am

  2. It would,

    Though I honestly do not expect little things as these to be given a lot of priority :)

    Comment :: February 14, 2008 @ 6:42 am

  3. 3. peterwang

    hi, what’s your mysql version?
    it doesn’t work for me.
    version:
    /usr/libexec/mysqld Ver 4.1.18 for pc-linux-gnu on i686 (Source distribution)

    Comment :: February 18, 2008 @ 1:22 am

  4. Hm. I think it worked for MySQL 4.1
    I tested it with MySQL 5.0

    Comment :: February 18, 2008 @ 6:40 am

 

Subscribe without commenting


This page was found by: mysql config mysql config file check mysql version how to check mysql v... check mysql config