ハマりました orz
Phenomenon.
- 以下のように mysql-5.1.XX binary distribution の mysql_install_db が失敗する。
root# pwd /usr/local/mysql-5.1.XX-linux-x86_64-glibc23 root# ./scripts/mysql_install_db --user=mysql FATAL ERROR: Could not find mysqld The following directories were searched: /usr/libexec /usr/sbin /usr/bin If you compiled from source, you need to run 'make install' to copy the software into the correct location ready for operation. If you are using a binary release, you must either be at the top level of the extracted archive, or pass the --basedir option pointing to that location.
- エラーメッセージの指示に従って、 --basedir を設定しても、失敗する
root# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql Installing MySQL system tables... 100421 14:39:54 [ERROR] /usr/local/mysql/bin/mysqld: unknown option '--skip-bdb' 100421 14:39:54 [ERROR] Aborting 100421 14:39:54 [Warning] Forcing shutdown of 2 plugins 100421 14:39:54 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete Installation of system tables failed! Examine the logs in /var/lib/mysql for more information. You can try to start the mysqld daemon with: shell> /usr/local/mysql/bin/mysqld --skip-grant & and use the command line tool /usr/local/mysql/bin/mysql to connect to the mysql database and look at the grant tables: shell> /usr/local/mysql/bin/mysql -u root mysql mysql> show tables Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in /var/lib/mysql that may be helpful. The latest information about MySQL is available on the web at http://www.mysql.com/. Please consult the MySQL manual section 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source are the MySQL email archives available at http://lists.mysql.com/. Please check all of the above before mailing us! And remember, if you do mail us, you MUST use the /usr/local/mysql/scripts/mysqlbug script!
Causation.
- my_intall_db 実行時に、 /etc/mysql/my.cnf を参照してしまっていること。
- my_intall_db 内部で
/usr/local/mysql-5.1.XX-linux-x86_64-glibc23/bin/mysqld を実行する際に、
--skip-bdb が実行 error になっている。 - --skip-bdb は /etc/mysql/my.cnf に指定されている。
- my_intall_db 内部で
How To Work Around.
- 以下のいずれかを行なうことで回避できる。
- /etc/mysql/my.cnf を rm して my_intall_db を実行する。
- my_intall_db を --no-defaults オプションをつけて実行する。
- 以下、前者で実施した際の例:
root# cd /etc/mysql/ root# mv my.cnf my.cnf.X root# cd /usr/local/mysql-5.1.XX-linux-x86_64-glibc23 root# ./scripts/mysql_install_db --user=mysql Installing MySQL system tables... 100421 14:18:56 [Warning] Forcing shutdown of 2 plugins OK Filling help tables... 100421 14:18:56 [Warning] Forcing shutdown of 2 plugins OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: ./bin/mysqladmin -u root password 'new-password' ./bin/mysqladmin -u root -h lab-svr106d password 'new-password' Alternatively you can run: ./bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd ./mysql-test ; perl mysql-test-run.pl Please report any problems with the ./bin/mysqlbug script! The latest information about MySQL is available at http://www.mysql.com/ Support MySQL by buying support/licenses from http://shop.mysql.com/