问题描述:在安装mysql,进行初始化操作的时候报错“FATAL ERROR: Could not find mysqld”
mysql版本:5.5.11
具体报错:
# cd /usr/local/mysql-5.5.11-linux2.6-x86_64
# ./scripts/mysql_install_db --defaults-file=/etc/my_mob.cnf --user=mysql
FATAL ERROR: Could not find mysqld
The following directories were searched:
/usr/local/mysql/libexec
/usr/local/mysql/sbin
/usr/local/mysql/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.
原因分析:
这里初始化搜索的路径是 /usr/local/mysql/bin,但实际应该是/usr/local/mysql-5.5.11-linux2.6-x86_64
配置文件中mysql基目录是/usr/local/mysql,但实际是/usr/local/mysql-5.5.11-linux2.6-x86_64,修改配置文件可以解决
当然,我们如果没有其他版本的mysql在当前服务器上,可以创建软连接(/usr/local/mysql --->/usr/local/mysql-5.5.11-linux2.6-x86_64)也是可以的。
解决方法:修改配置文件
#vi /etc/my_mob.cnf
mysql版本:5.5.11
具体报错:
# cd /usr/local/mysql-5.5.11-linux2.6-x86_64
# ./scripts/mysql_install_db --defaults-file=/etc/my_mob.cnf --user=mysql
FATAL ERROR: Could not find mysqld
The following directories were searched:
/usr/local/mysql/libexec
/usr/local/mysql/sbin
/usr/local/mysql/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.
原因分析:
这里初始化搜索的路径是 /usr/local/mysql/bin,但实际应该是/usr/local/mysql-5.5.11-linux2.6-x86_64
配置文件中mysql基目录是/usr/local/mysql,但实际是/usr/local/mysql-5.5.11-linux2.6-x86_64,修改配置文件可以解决
当然,我们如果没有其他版本的mysql在当前服务器上,可以创建软连接(/usr/local/mysql --->/usr/local/mysql-5.5.11-linux2.6-x86_64)也是可以的。
解决方法:修改配置文件
#vi /etc/my_mob.cnf
basedir=/usr/local/mysql ---> /usr/local/mysql-5.5.11-linux2.6-x86_64
本文解决了一个在MySQL 5.5.11版本安装过程中遇到的初始化错误“FATAL ERROR: Could not find mysqld”。问题源于配置文件中指定的路径与实际安装路径不符。文章提供了修改配置文件和创建软链接两种解决方案。
525

被折叠的 条评论
为什么被折叠?



