yum 安装的mysql,在执行mysql_install_db时出现问题

netxuning 2013-02-21 03:00:36
起初执行 /usr/bin/mysql_install_db --user=mysql --datadir=/var/lib/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/ 目录了;
然后按照后边提示二进制安装的方法,指定了--basedir=/或--basedir=/usr 依然是这样的错误。

这个问题该如何解决?
...全文
756 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
rucypli 2013-02-25
  • 打赏
  • 举报
回复
请分享最后如何解决的啊
netxuning 2013-02-25
  • 打赏
  • 举报
回复
引用 9 楼 rucypli 的回复:
请分享最后如何解决的啊
最后只能下载了个5.1.68源码包,源码安装的,yum实在按不上
netxuning 2013-02-22
  • 打赏
  • 举报
回复
而且权限看着也没问题:

ls -lh mysql/plugin.*
-rw-rw----. 1 mysql mysql 8.4K  2月  8 2012 mysql/plugin.frm
-rw-rw----. 1 mysql mysql    0  2月  8 2012 mysql/plugin.MYD
-rw-rw----. 1 mysql mysql 1.0K  2月  8 2012 mysql/plugin.MYI
netxuning 2013-02-22
  • 打赏
  • 举报
回复
奇怪的是,数据库里有mysql.plugin这个表啊,

mysql> desc mysql.plugin;
+-------+-----------+------+-----+---------+-------+
| Field | Type      | Null | Key | Default | Extra |
+-------+-----------+------+-----+---------+-------+
| name  | char(64)  | NO   | PRI |         |       |
| dl    | char(128) | NO   |     |         |       |
+-------+-----------+------+-----+---------+-------+
2 rows in set (0.00 sec)
为什么还提示Can't open the mysql.plugin table的错误?
netxuning 2013-02-22
  • 打赏
  • 举报
回复
引用 5 楼 rucypli 的回复:
5.1.67的什么新特性需要从5.1.37升级上去
5.1.37在主从同步的binlog_format设置为statement时,会发生严重的错误,但由于主从表结构有些差异,又不能将binlog_format改为mixed或row。 经过测试,5.1.67无此问题,升级更高的版本又怕驾驭不了,所以就想升级5.1.67。同时,以后要进行运营维护的新手又不怎么懂源码安装,所以倾向于yum直接安装。 这正是麻烦之处!
rucypli 2013-02-21
  • 打赏
  • 举报
回复
5.1.67的什么新特性需要从5.1.37升级上去
netxuning 2013-02-21
  • 打赏
  • 举报
回复
引用 2 楼 rucypli 的回复:
yum装的是rpm包 装完 服务启动即可用 mysql_install_db 脚本的目的是生成新的MySQL授权表 是升级mysql或者装二进制包的时候才需要
是这样的,以前用的是5.1.37的源码包的版本,现在希望用yum 安装5.1.67,但还用以前的数据表及各种配置,所以mysql_install_db 一下。 其实我本来也不清楚要执行mysql_install_db 操作,但是新启动安装的版本时出错: 130221 15:09:21 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 130221 15:09:21 InnoDB: Initializing buffer pool, size = 8.0M 130221 15:09:21 InnoDB: Completed initialization of buffer pool 130221 15:09:21 InnoDB: Started; log sequence number 0 44233 130221 15:09:21 [ERROR] Aborting 导致启动失败,一开始按着错误提示执行/usr/bin/mysql_upgrade,执行的过程中提示了很多ok。但之后在启动依然出现“ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.”这个错误。 然后在网上查,有说需要执行mysql_install_db才行的,故而有此问。 如果能够直接解决Can't open the mysql.plugin table的错误就更好了,先谢谢了
  • 打赏
  • 举报
回复
yum 安装的会帮你直接装好,用命令启动mysql就好了,:/etc/init.d/mysqld start
rucypli 2013-02-21
  • 打赏
  • 举报
回复
yum装的是rpm包 装完 服务启动即可用 mysql_install_db 脚本的目的是生成新的MySQL授权表 是升级mysql或者装二进制包的时候才需要
rucypli 2013-02-21
  • 打赏
  • 举报
回复
yum完为什么还要mysql_install_db?

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧