fedora20 Starting MySQL. ERROR! The server quit without updating PID file /var/lib/mysql/Master.Hado

来源:互联网 发布:淘宝网登陆页 编辑:程序博客网 时间:2024/04/30 11:07

今天尝试在fedora20下安装了下mysql,


查看/var/lib/mysql/Master.Hadoop.err日志发现报了如下的错于是找到这篇文章,才得以解决。

Table 'mysql.plugin' doesn't exist。


但是很不幸的是,安装过程中出现了错误,到网上查了很久解决方案,

最后才搞定,下面简单说下安装步骤:
1、yum -y install mysql mysql-server
      此时系统会自动帮你安装好mysql-server,mysql-client以及其依赖的所有包,这是很方便的地方。此时mysql
     已经安装完毕。

2、启动mysqld。
      在终端键入systemctl start mysql.service(或者service mysqld start)即可启动mysqld。但是这里不幸的是,系统报错了:
Redirecting to /bin/systemctl start mysqld.service
                     Job
failed. See system logs and 'systemctl status' for details.

然后我就去/var/log/mysqld.log中查看具体的失败原因,发现错误提示为:
 120505 11:16:50 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120505 11:16:50 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
120505 11:16:50 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

120505 11:16:50 InnoDB: The InnoDB memory heap is disabled
120505 11:16:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120505 11:16:50 InnoDB: Compressed tables use zlib 1.2.5
120505 11:16:50 InnoDB: Using Linux native AIO
120505 11:16:51 InnoDB: Initializing buffer pool, size = 128.0M
120505 11:16:51 InnoDB: Completed initialization of buffer pool
120505 11:16:51 InnoDB: highest supported file format is Barracuda.
120505 11:16:51  InnoDB: Waiting for the background threads to start
120505 11:16:52 InnoDB: 1.1.8 started; log sequence number 1595675
该错误的意思很明白,就是说安装mysql数据库后默认的表结构没有初始化,所以当你启动mysqld时,会提示
 说
Table 'mysql.plugin' doesn't exist。因此,我们需要把mysql的默认数据结构初始化下,具体解决办法如下:
  在终端键入
/usr/bin/mysql_install_db--user=mysql --datadir=/var/lib/mysql(为方便起见,这里的值就直接与/etc/my.cnf中的datadir值保持一致),如此以来,就解决了上面的问题。
0 0