CentOS 7 安装 MySQL 5.6遇到的各种问题小结
作者:mrr 发布时间:2024-01-20 23:51:39
在一测试服务器(CentOS Linux release 7.2.1511)上安装MySQL 5.6(5.6.19 MySQL Community Server)时遇到下面错误,这个是因为CentOS 7的默认数据库已经不再是MySQL了,而是MariaDB. MySQL安装时的mysql lib库与mariadb的库、包冲突了,如下详情所示(省略了大量日志)
[root@azrlnx06 tmp]# rpm -ivh MySQL-server-advanced-5.6.20-1.rhel5.x86_64.rpm
Preparing... ################################# [100%]
file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
........................................................................................................................................................................
file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
检查是否存在mariadb的相关组件,然后删除mariadb相关组件。如下所示:
[root@azrlnx06 mysql]# more /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@azrlnx06 mysql]# rpm -qa |grep mariadb
mariadb-libs-5.5.50-1.el7_2.x86_64
[root@azrlnx06 mysql]# rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64
error: Failed dependencies:
libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
[root@azrlnx06 mysql]# rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64 --nodeps
当然此处删除mariadb-libs-5.5.50-1.el7_2.x86_64组件时遇到依赖错误,遂强制删除该组件,最好使用yum删除mariadb相关组件。然后重新安装MySQL时遇到"error: MySQL-server-advanced-5.6.20-1.rhel5.x86_64: install failed"错误,如下所示:
[root@azrlnx06 mysql]# cd /tmp
[root@azrlnx06 tmp]# ls
hsperfdata_azrlnx06 jirasetup MySQL-server-advanced-5.6.20-1.rhel5.x86_64.rpm
[root@azrlnx06 tmp]# rpm -ivh MySQL-server-advanced-5.6.20-1.rhel5.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-server-advanced-5.6.20-1.rh################################# [100%]
error: unpacking of archive failed on file /usr/bin/innochecksum;582535c8: cpio: read failed - No such file or directory
error: MySQL-server-advanced-5.6.20-1.rhel5.x86_64: install failed
[root@azrlnx06 tmp]#
clip_image001
对这个错误有点莫名其妙,卸载MySQL相关组件后,重新安装MySQL,发现缺少Perl相关模组。如下所示:
[root@azrlnx06 jirasetup]# rpm -ivh MySQL-server-advanced-5.6.20-1.rhel5.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-server-advanced-5.6.20-1.rh################################# [100%]
FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:
Data::Dumper
[root@azrlnx06 jirasetup]#
使用yum安装了 perl perl-devel相关包(注意:此处安装MySQL时,没有输出安装相关Detail的信息,是因为Perl相关模组没有安装的缘故,此处还漏掉了安装perl-Data-Dumper)
[root@azrlnx06 jirasetup]# yum install -y perl perl-devel
安装完Perl相关组件后,重新安装MySQL,如下所示,安装成功,但是没有输出安装相关Detail的信息(因为没有安装perl-Data-Dumper),启动MySQL报错
root@azrlnx06 jirasetup]# rpm -ivh MySQL-server-advanced-5.6.20-1.rhel5.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-server-advanced-5.6.20-1.rh################################# [100%]
[root@azrlnx06 jirasetup]# rpm -ivh MySQL-client-advanced-5.6.20-1.rhel5.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-client-advanced-5.6.20-1.rh################################# [100%]
[root@azrlnx06 ~]# service mysql start
Starting MySQL............. ERROR! The server quit without updating PID file (/var/lib/mysql/azrlnx06.pid).
[root@azrlnx06 ~]#
找到MySQL的错误日志,然后检查/var/lib/mysql/azrlnx06.err错误日志,发现如下错误信息:
[root@azrlnx06 mysql]# find / -name *.err
/var/lib/mysql/azrlnx06.err
/var/log/azure/Microsoft.OSTCExtensions.LinuxDiagnostic/2.3.9011/mdsd.err
/var/log/azure/Microsoft.OSTCExtensions.LinuxDiagnostic/2.3.9013/mdsd.err
/var/log/mdsd/mdsd.err
[root@azrlnx06 mysql]# more /var/lib/mysql/azrlnx06.err
161111 03:28:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2016-11-11 03:28:25 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-11-11 03:28:25 2144 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
2016-11-11 03:28:25 2144 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2016-11-11 03:28:25 2144 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-11-11 03:28:25 2144 [Note] InnoDB: The InnoDB memory heap is disabled
2016-11-11 03:28:25 2144 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-11-11 03:28:25 2144 [Note] InnoDB: Memory barrier is not used
2016-11-11 03:28:25 2144 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-11-11 03:28:25 2144 [Note] InnoDB: Using Linux native AIO
2016-11-11 03:28:25 2144 [Note] InnoDB: Using CPU crc32 instructions
2016-11-11 03:28:25 2144 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-11-11 03:28:25 2144 [Note] InnoDB: Completed initialization of buffer pool
2016-11-11 03:28:25 2144 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-11-11 03:28:25 2144 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-11-11 03:28:25 2144 [Note] InnoDB: Database physically writes the file full: wait...
2016-11-11 03:28:26 2144 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-11-11 03:28:31 2144 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-11-11 03:28:37 2144 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-11-11 03:28:37 2144 [Warning] InnoDB: New log files created, LSN=45781
2016-11-11 03:28:37 2144 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-11-11 03:28:37 2144 [Note] InnoDB: Doublewrite buffer created
2016-11-11 03:28:37 2144 [Note] InnoDB: 128 rollback segment(s) are active.
2016-11-11 03:28:37 2144 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-11-11 03:28:37 2144 [Note] InnoDB: Foreign key constraint system tables created
2016-11-11 03:28:37 2144 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-11-11 03:28:38 2144 [Note] InnoDB: Tablespace and datafile system tables created.
2016-11-11 03:28:38 2144 [Note] InnoDB: Waiting for purge to start
2016-11-11 03:28:38 2144 [Note] InnoDB: 5.6.20 started; log sequence number 0
2016-11-11 03:28:38 2144 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ef3b0cd5-a7be-11e6-98b3-000d3a8062fe.
2016-11-11 03:28:38 2144 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2016-11-11 03:28:38 2144 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2016-11-11 03:28:38 2144 [Note] Server hostname (bind-address): '*'; port: 3306
2016-11-11 03:28:38 2144 [Note] IPv6 is available.
2016-11-11 03:28:38 2144 [Note] - '::' resolves to '::';
2016-11-11 03:28:38 2144 [Note] Server socket created on IP: '::'.
2016-11-11 03:28:38 2144 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
161111 03:28:38 mysqld_safe mysqld from pid file /var/lib/mysql/azrlnx06.pid ended
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信息输出了。
以上所述是小编给大家介绍的CentOS 7 安装 MySQL 5.6遇到的各种冲突问题网站的支持!


猜你喜欢
- 解读model.named_parameters()与model.parameters()model.named_parameters()迭
- 情景一: 表中数据 name score aaa 11 aaa 19 bbb 12 bbb 18 ccc 19 ddd 21 期望查询结果如
- 前言今天,在网上发现一款很棒的python画图工具库。很简单的api调用就能生成漂亮的图表。并且可以进行一些互动。pyecharts 是一个
- 需求:爬取搜狗首页的页面数据import requests# 1.指定urlurl = 'https://www.sogou.com
- 每当有朋友过生日时,生日蛋糕自然是必不可少的,今天我们来看一下如何用 Python 画一个生日蛋糕。本文我们用到的 Python 库包括:t
- 使用PDB的方式有两种:1. 单步执行代码,通过命令 python -m pdb xxx.py 启动脚本,进入单步执行模式 pdb
- RGB图像转灰度图RGB图像转换为灰度图时通常使用:进行转换,以下尝试通过其他对图像像素操作的方式将RGB图像转换为灰度图像。#includ
- 本文实例讲述了PHP队列用法。分享给大家供大家参考。具体分析如下:什么是队列,是先进先出的线性表,在具体应用中通常用链表或者数组来实现,队列
- 占位符通过占位符,可以指定格式进行输入或输出,以下为 fmt 标准库里的占位符:普通占位符占位符描述举例结果%v默认格式的值fmt.Prin
- Linux服务器有CentOS、Fedora等,都预先安装了Python,版本从2.4到2.5不等,而Windows类型的服务器也多数安装了
- 页面自动刷新代码大全,基本上所有要求自动刷新页面的代码都有,大家可以自由发挥做出完美的页面。 1)10表示间隔10秒刷 ...页面自动刷新代
- 当各位在安装、重装时出现could not start the service mysql error:0原因: 卸载mysql时并没有完全
- <?php//===============================时间日期=========================
- 前提环境准备python3+pillow+pyautogui先提前安装好python3以及pillow和pyautogui模块这里介绍一下模
- 本文实例为大家分享了PHP变量传值赋值和引用赋值变量销毁的具体代码,供大家参考,具体内容如下<?php $a = 100
- 堆 heap 值类型 原始类型(primitive type) Undefined: undefined (注意大小写:类型/ 值,下同)
- 说起计算机中的时间,还有一些比较有意思的事,比如我们经常听到的Unix时间戳,UTC时间,格林威治时间等,从表示上来讲他们基本属于同一个东西
- 今天写了一个简单的验证,本来前面用的组件,但是感觉写的组件在此项目不是很好用,由于用到的地方比较少,所以直接写在了页面中。<div&g
- 自从SQL Server 2005推出后,因为有了更好的性能,所以有很多与SQL Server 2000相关的应用程序需要升级到这个版本。但
- exec函数,可以循环定义、赋值多个变量exec ("temp%s=1"%1)这段代码的意思是,让exec执行temp1