在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

CentOS7安装MySQL5.6遇到的问题怎么解决

120次阅读
没有评论

共计 9918 个字符,预计需要花费 25 分钟才能阅读完成。

这篇文章主要介绍“CentOS7 安装 MySQL5.6 遇到的问题怎么解决”,在日常操作中,相信很多人在 CentOS7 安装 MySQL5.6 遇到的问题怎么解决问题上存在疑惑,丸趣 TV 小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”CentOS7 安装 MySQL5.6 遇到的问题怎么解决”的疑惑有所帮助!接下来,请跟着丸趣 TV 小编一起来学习吧!

在一测试服务器(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 信息输出了。

到此,关于“CentOS7 安装 MySQL5.6 遇到的问题怎么解决”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注丸趣 TV 网站,丸趣 TV 小编会继续努力为大家带来更多实用的文章!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-13发表,共计9918字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 成a人片在线观看 | 亚洲日韩欧美内射姐弟 | 好屌草这里只有精品 | 精品在线一区二区三区 | 久久精品视频播放 | 中国精学生妹品射精久久 | 狠狠操人人 | 国产午夜激无码av毛片 | 五月综合激情婷婷六月 | 中文字幕日韩欧美一区二区三区 | 视频一区二区三区免费观看 | 亚洲国产精品一区二区九九 | 毛片tv| 亚洲女女女同性video | 国产永久免费高清在线观看 | 久久精品国产亚洲av麻豆网站 | 青草伊人久久综在合线亚洲 | 粉嫩被粗大进进出出视频 | 国产精品熟女一区二区 | 国产av无码专区亚洲av麻豆丫 | 在线黄视频网站 | 成 人国产在线观看高清不卡 | 国产区精品福利在线社区 | 国产精品自在线拍国产 | 综合 91在线精品 | 亚洲永久免费网站 | 日本网站在线播放 | 成人久久免费网站 | 国语对白做受xxxxx在线中国 | 99色影院| 极品精品国产超清自在线观看 | 久久视频精品 | 国产精品爱久久久久久久小说 | 国产麻豆剧传媒精品国产免费 | 欧美在线一级va免费观看 | 亚洲不卡在线观看 | 国产欧美另类久久久精品免费 | 亚洲综合区图片小说区 | 亚洲欧洲偷自拍图片区 | 亚洲视频免费观看 | 久久久久亚洲精品影视 |