- June 29, 2007 2:10 PM
http://dev.mysql.com/doc/refman/5.0/en/option-files.html
--defaults-group-suffix=strIf this option is given, the program reads not only its usual option groups, but also groups with the usual names and a suffix of
str. For example, the mysql client normally reads the[client]and[mysql]groups. If the--default-group-suffix=_otheroption is given, mysql also reads the[client_other]and[mysql_other]groups. This option was added in MySQL 5.0.10.
このマニュアルを読む限り、設定ファイルのセクション名を拡張するオプションの様子。
_otherと指定すると、mysqld_otherも、合わせて読んでくれる模様。
mysqldでは、もちろん--defaults-group-suffixは有効
[root@h1 mysql]# mysqld --defaults-group-suffix=_test -uroot &mysqld_safeでは、起動しない。
[1] 21682
[root@h1 mysql]# 070629 19:54:22 InnoDB: Started; log sequence number 0 43655
070629 19:54:22 [Note] mysqld: ready for connections.
Version: '5.0.42-enterprise-gpl' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Enterprise Server (GPL)
[root@h1 mysql]# mysqld_safe --defaults-group-suffix=_test -uroot &エラーログを確認すると、何故か--defaults-group-suffixが「無効なオプション」として認識されている様子。
[1] 21724
[root@h1 mysql]# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/lib/mysql/h1.pid
070629 19:55:45 mysqld ended
[1]+ Done mysqld_safe --defaults-group-suffix=_test -uroot
[root@h1 mysql]# tail h1.err
<略>
070629 19:55:45 [ERROR] /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=_test'
070629 19:55:45 mysqld ended
原因:mysqldへオプションを渡すとき、先頭で指定していない場合は、エラーとなるバグのよう。
[root@h1 mysql]# mysqld --max_connections=10 --defaults-group-suffix=_test -uroot & [1] 21792
[root@h1 mysql]# 070629 20:17:24 [ERROR] mysqld: unknown variable 'defaults-group-suffix=_test'
mysqld_safeは、いくつかのオプションをつけてから、mysqldへオプションを渡しているので、毎回エラーとなったよう。