【MySQL】mysql启动报错./mysqld_safe: my_print_defaults: not found

【问题描述 】:
在安装老版本的mysql并启动时发现的错误:(mysql5.0)

  1. $ cd /data/mysql/bin
  2. $ ./mysqld_safe &

报错信息:
  1. root@10:/data/mysql/bin# ./mysqld_safe &
  2. [1] 4301
  3. root@10:/data/mysql/bin# ./mysqld_safe: 1: ./mysqld_safe: my_print_defaults: not found
  4. ./mysqld_safe: 1: ./mysqld_safe: my_print_defaults: not found
  5. The file /usr/local/mysql/bin/mysqld doesn't exist or is not executable
  6. Please do a cd to the mysql installation directory and restart
  7. this script from there as follows:
  8. ./bin/mysqld_safe.
  9. See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more
  10. information

在错误日志里也没有被记录,并且在确认了配置文件无误之后仍然报这个错。


google了一下,发现原来是一个bug,官方早在08年就已经承认并记录。
在mysql 5.0/5.1/5.5版本都有可能出现,在12年10月修正,并且在mysql5.5.19以后的版本中将不再出现。


可参考:http://bugs.mysql.com/bug.php?id=34981



【解决方案 】:
往下翻评论,发现一个简单易用的解决方法:

[3 Mar 2008 21:17] Omer Barnir
workaround: cd to 'basedir' and run ./bin/mysqld_safe to avoid the issue

意思是进入basedir目录,找./bin/mysqld_safe并启动就可以了。


此处是返回上级目录:
  1. root@10:/data/mysql/bin# cd ..
  2. root@10:/data/mysql# ./bin/mysqld_safe &
  3. [1] 4391
  4. root@10:/data/mysql# nohup: ignoring input and redirecting stderr to stdout
  5. Starting mysqld daemon with databases from /data/mysql-data
  6. root@10:/data/mysql#
  7. root@10:/data/mysql# ps -ef|grep mysql
  8. root 4391 4185 0 10:23 pts/0 00:00:00 /bin/sh ./bin/mysqld_safe
  9. root 4422 4391 0 10:23 pts/0 00:00:00 /data/mysql/bin/mysqld --basedir=/data/mysql --datadir=/data/mysql-data --user=root --pid-file=/data/mysql-data/mysqld.pid --skip-external-locking --socket=/tmp/mysql.sock
  10. root 4435 4185 0 10:23 pts/0 00:00:00 grep mysql
  11. …………………………

启动成功。


作者微信公众号(持续更新)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29773961/viewspace-1994220/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29773961/viewspace-1994220/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值