您的位置:首页 > 数据库 > MySQL

mysql安装初始化操作报错“FATAL ERROR: Could not find mysqld”

2014-11-04 23:23 417 查看
问题描述:在安装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
basedir=/usr/local/mysql --->   /usr/local/mysql-5.5.11-linux2.6-x86_64

参考文档:https://mariadb.com/kb/en/mariadb/documentation/getting-started/troubleshooting-installation-issues/mariadb-fatal-error-could-not-find-mysqld-when-run-the-script-scriptsmysql_/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐