mysqlエラー

「error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'

Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!」



について。



前回記事「MovableTypeとMysqlの不具合_3(Mysql4.1系ソースからインストール作業) 」 において


mysqlインストール作業中の初期DBを生成時に何やら問題が発生。

# ./scripts/mysql_install_db
Installing all prepared tables
Fill help tables

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:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h oregano-esil.ddo.jp password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com

See the manual for more instructions.

NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/local/mysql/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.co


この後、mysqlの起動はしているようではあるが


#mysqladmin ping コマンドを実行してみると


/tmp/mysql.sockが存在しないのでは?という以下のエラーメッセージが表示された。


# /usr/local/mysql/bin/mysqld_safe &
[2] 2553
# Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/oregano-esil.ddo.jp.pid
060709 23:34:20 mysqld ended


[2]+ Done /usr/local/mysql/bin/mysqld_safe
#
#
# mysqladmin ping
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
# jobs
[1]+ Running /usr/local/mysql/bin/mysqld_safe &

# ls /tmp/
clamav-80c26491e8220506/ lost+found/ mapping-shin= plugtmp/
clamd= mCp8PIXHoe mt-throttle.db
gconfd-root/ mapping-root= orbit-root/


確認したところ、たしかにない。


#make clean コマンドを実行し、再度インストールし直してみた。


そして、再度初期DBの作成、起動。


今度はmysqladmin pingコマンドが通るようになりました。


そして、/tmp/mysql.sockファイルもDB起動に作成されるようになった。


なんだったんだろうね。