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

问题描述:在安装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_/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值