CentOS 7 安装MySQL 5.6遇到问题及解决方案(3)

clip_image002

搜索了一些相关资料,应该是perl-Data-Dumper模组没有安装,导致安装过程中,初始化数据库失败,所以启动MySQL服务时,找不到相关系统表。具体参考官方文档MySQL-server RPM does not install perl-Data-Dumper as a dependency

Description:

MySQL-server requires perl-Data-Dumper to function. However, perl-Data-Dumper is not listed by the MySQL-server RPM as a dependency. So if a linux server does not have perl-Data-Dumper installed, the install-mysql-db will fail. And because of missing the initial database, the mysql service could not be started.

How to repeat:

On a linux server, make sure there is no perl-Data-Dumper installed. Install MySQL-server using yum. There should be error message complaining database could not be created.

Suggested fix:

Add perl-Data-Dumper as a dependency of the RPM package

解决方法:

1:安装perl-Data-Dumper模组。

[root@azrlnx06 mysql]# yum install -y perl-Data-Dumper

2:初始化数据库

[root@azrlnx06 mysql]# sudo mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/

clip_image003

[root@azrlnx06 mysql]# service mysql start   Starting MySQL. SUCCESS!   [root@azrlnx06 mysql]# /usr//bin/mysqladmin -u root password 'Qwe!23'   Warning: Using a password on the command line interface can be insecure.

当然也可以卸载MySQL,然后重新安装,就能看到安装过程输出的Detail信息输出了。

clip_image004

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6f92d9c00915ee9d6c48d85e5ab45c32.html