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::PHP Large result sets and summary tables.:
 

5 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

  5. Yup. I think the problem might be with your configuration. I use Mysql version 5.0.
    and I get following message, I am not use of the warning message. Can you help

    090922 2:30:57 [Warning] option ‘max_join_size’: unsigned value 18446744073709551615 adjusted to 4294967295
    090922 2:30:57 [Warning] option ‘max_join_size’: unsigned value 18446744073709551615 adjusted to 4294967295

    /usr/libexec/mysqld Ver 5.0.67 for redhat-linux-gnu on i386 (Source distribution)
    Copyright (C) 2000 MySQL AB, by Monty and others
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license

    Starts the MySQL database server

    Usage: /usr/libexec/mysqld [OPTIONS]

    For more help options (several pages), use mysqld –verbose –help

    Comment :: September 20, 2009 @ 8:21 am

 

Subscribe without commenting

Trackbacks/Pingbacks