No such file or directory -- MYSQL 二进制版本启动失败

本文记录了一次使用二进制版MySQL 5.6.21安装后遇到的问题:使用mysqld_safe启动时报错,必须在安装目录下才能正常启动。通过调整启动脚本和配置文件,最终成功启动MySQL。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

$tar xf mysql-advanced-5.6.21-linux-glibc2.5-x86_64.tar.gz -C /db/

使用二进制版的mysql-advanced-5.6.21-linux-glibc2.5-x86_64.tar.gz安装后,修改了
--log-error的路径,用mysqld_safe启动一直报错。必须到安装目录下启动才行。

1.查看mysqld_safe的路径
$ which mysqld_safe
/db/mysql5.6/bin/mysqld_safe

2.用mysqld_safe启动mysql,启动失败
$ mysqld_safe     
141024 17:02:04 mysqld_safe Logging to '/usr/local/mysql/data/mysql02.err'.
touch: cannot touch `/usr/local/mysql/data/mysql02.err': No such file or directory
chmod: cannot access `/usr/local/mysql/data/mysql02.err': No such file or directory
141024 17:02:04 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
/db/mysql5.6/bin/mysqld_safe: line 129: /usr/local/mysql/data/mysql02.err: No such file or directory


3.mysqld_safe指定my.cnf启动mysql,失败
$ mysqld_safe  --defaults-file=/db/mysql5.6/my.cnf  
141024 17:02:28 mysqld_safe Logging to '/db/mysql5.6/logs/error_log_98_3316.err'.
141024 17:02:28 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

4. 根据提示进入到MYSQL安装路径,启动OK
Please cd to the mysql installation directory and restart this script from there as follows
为什么呢?是个bug吗?

$ cd mysql5.6/
$ ./bin/mysqld_safe &
[1] 13192

$ pidof mysqld
13908

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值