使用二進制編譯文件的mysqld_safe啟動報錯,如下:
[mysql@ECP-UC-DB1 ~]$ mysqld_safe
110707 21:31:19 mysqld_safe Logging to ‘/opt/mysql/mysqldata/ECP-UC-DB1.err’.
110707 21:31:19 mysqld_safe The file /usr/local/mysql/bin/mysqld
does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows:
./bin/mysqld_safe&
See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information
解決方法:
su – root
mkdir /usr/local/mysql/bin
ln -s /opt/mysql/product/5.5/bin/mysqld /usr/local/mysql/bin/mysqld
再次執行mysqld_safe
[mysql@ECP-UC-DB1 ~]$ mysqld_safe
110707 21:32:37 mysqld_safe Logging to ‘/opt/mysql/mysqldata/ECP-UC-DB1.err’.
110707 21:32:37 mysqld_safe Starting mysqld daemon with databases from /opt/mysql/mysqldata
啟動結果:
mysql 26885 23452 0 21:32 pts/0 00:00:00 /bin/sh /opt/mysql/product/5.5/bin/mysqld_safe
mysql 27653 26885 0 21:32 pts/0 00:00:00 /usr/local/mysql/bin/mysqld –basedir=/opt/mysql/product/5.5 –datadir=/opt/mysql/mysqldata –plugin-dir=/usr/local/mysql/lib/plugin –log-error=/opt/mysql/mysqldata/ECP-UC-DB1.err –open-files-limit=8192 –pid-file=/var/run/mysqld/mysqld.pid –socket=/var/run/mysqld/mysqld.sock –port=3306
問題存在原因:
1、mysqld_safe只認識/usr/local/mysql/bin/mysqld(也許是配置問題)
2、my.cnf只能放置在/etc/下面,不然使用–defaults-file也不能讀取my.cnf文件(有疑惑)
總結,不一樣的問題可能會有一點區別,大家需要根據自己的經驗來分析原因哦。