CentOS7安装MySQL5.6遇到的问题有哪些

在一测试服务器(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_64file /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_64file /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_64file /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_64file /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_64file /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_64file /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_64file /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_64file /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 mariadbmariadb-libs-5.5.50-1.el7_2.x86_64[root@azrlnx06 mysql]# rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64error: failed dependencies:libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64libmysqlclient.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]# lshsperfdata_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 directoryerror: 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 startstarting 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.err161111 03:28:25 mysqld_safe starting mysqld daemon with databases from /var/lib/mysql2016-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 exist2016-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 pages2016-11-11 03:28:25 2144 [note] innodb: the innodb memory heap is disabled2016-11-11 03:28:25 2144 [note] innodb: mutexes and rw_locks use gcc atomic builtins2016-11-11 03:28:25 2144 [note] innodb: memory barrier is not used2016-11-11 03:28:25 2144 [note] innodb: compressed tables use zlib 1.2.32016-11-11 03:28:25 2144 [note] innodb: using linux native aio2016-11-11 03:28:25 2144 [note] innodb: using cpu crc32 instructions2016-11-11 03:28:25 2144 [note] innodb: initializing buffer pool, size = 128.0m2016-11-11 03:28:25 2144 [note] innodb: completed initialization of buffer pool2016-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 mb2016-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 mb2016-11-11 03:28:31 2144 [note] innodb: setting log file ./ib_logfile1 size to 48 mb2016-11-11 03:28:37 2144 [note] innodb: renaming log file ./ib_logfile101 to ./ib_logfile02016-11-11 03:28:37 2144 [warning] innodb: new log files created, lsn=457812016-11-11 03:28:37 2144 [note] innodb: doublewrite buffer not found: creating new2016-11-11 03:28:37 2144 [note] innodb: doublewrite buffer created2016-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 created2016-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 start2016-11-11 03:28:38 2144 [note] innodb: 5.6.20 started; log sequence number 02016-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: 33062016-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 exist161111 03:28:38 mysqld_safe mysqld from pid file /var/lib/mysql/azrlnx06.pid endedclip_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.

易语言学习手册 十天学会易语言图解教程  pdf版 易语言学习手册 十天学会易语言图解教程 pdf版

十天学会易语言图解教程用图解的方式对易语言的使用方法和操作技巧作了生动、系统的讲解。需要的朋友们可以下载看看吧!全书分十章,分十天讲完。 第一章是介绍易语言的安装,以及运行后的界面。同时介绍一个非常简单的小程序,以帮助用户入门学习。最后介绍编程的输入方法,以及一些初学者会遇到的常见问题。第二章将接触一些具体的问题,如怎样编写一个1+2等于几的程序,并了解变量的概念,变量的有效范围,数据类型等知识。其后,您将跟着本书,编写一个自己的MP3播放器,认识窗口、按钮、编辑框三个常用组件。以认识命令及事件子程序。第

易语言学习手册 十天学会易语言图解教程  pdf版 3 查看详情 易语言学习手册 十天学会易语言图解教程  pdf版

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 startstarting 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遇到的问题有哪些的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1029408.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2025年12月2日 03:02:15
下一篇 2025年12月2日 03:02:35

相关推荐

  • Word2013如何插入SmartArt图形_Word2013SmartArt插入的视觉表达

    答案:可通过四种方法在Word 2013中插入SmartArt图形。一、使用“插入”选项卡中的“SmartArt”按钮,选择所需类型并插入;二、从快速样式库中选择常用模板如组织结构图直接应用;三、复制已有SmartArt图形到目标文档后调整内容与格式;四、将带项目符号的文本选中后右键转换为Smart…

    2025年12月6日 软件教程
    000
  • 怎样用免费工具美化PPT_免费美化PPT的实用方法分享

    利用KIMI智能助手可免费将PPT美化为科技感风格,但需核对文字准确性;2. 天工AI擅长优化内容结构,提升逻辑性,适合高质量内容需求;3. SlidesAI支持语音输入与自动排版,操作便捷,利于紧急场景;4. Prezo提供多种模板,自动生成图文并茂幻灯片,适合学生与初创团队。 如果您有一份内容完…

    2025年12月6日 软件教程
    000
  • Pages怎么协作编辑同一文档 Pages多人实时协作的流程

    首先启用Pages共享功能,点击右上角共享按钮并选择“添加协作者”,设置为可编辑并生成链接;接着复制链接通过邮件或社交软件发送给成员,确保其使用Apple ID登录iCloud后即可加入编辑;也可直接在共享菜单中输入邮箱地址定向邀请,设定编辑权限后发送;最后在共享面板中管理协作者权限,查看实时在线状…

    2025年12月6日 软件教程
    100
  • word表格怎么调整行高_word表格行高调整的具体操作

    手动拖动可快速调整单行行高;2. 通过表格属性精确设置指定高度,选择固定值或最小值模式;3. 全选表格批量统一行高;4. 设为自动或最小值使行高随内容自适应,确保文字显示完整。 在使用Word制作表格时,调整行高是常见的排版需求。合理的行高能让表格内容更清晰易读。下面介绍几种常用的调整Word表格行…

    2025年12月6日 软件教程
    000
  • REDMI K90系列正式发布,售价2599元起!

    10月23日,redmi k90系列正式亮相,推出redmi k90与redmi k90 pro max两款新机。其中,redmi k90搭载骁龙8至尊版处理器、7100mah大电池及100w有线快充等多项旗舰配置,起售价为2599元,官方称其为k系列迄今为止最完整的标准版本。 图源:REDMI红米…

    2025年12月6日 行业动态
    200
  • Linux中如何安装Nginx服务_Linux安装Nginx服务的完整指南

    首先更新系统软件包,然后通过对应包管理器安装Nginx,启动并启用服务,开放防火墙端口,最后验证欢迎页显示以确认安装成功。 在Linux系统中安装Nginx服务是搭建Web服务器的第一步。Nginx以高性能、低资源消耗和良好的并发处理能力著称,广泛用于静态内容服务、反向代理和负载均衡。以下是在主流L…

    2025年12月6日 运维
    000
  • Linux journalctl与systemctl status结合分析

    先看 systemctl status 确认服务状态,再用 journalctl 查看详细日志。例如 nginx 启动失败时,systemctl status 显示 Active: failed,journalctl -u nginx 发现端口 80 被占用,结合两者可快速定位问题根源。 在 Lin…

    2025年12月6日 运维
    100
  • 华为新机发布计划曝光:Pura 90系列或明年4月登场

    近日,有数码博主透露了华为2025年至2026年的新品规划,其中pura 90系列预计在2026年4月发布,有望成为华为新一代影像旗舰。根据路线图,华为将在2025年底至2026年陆续推出mate 80系列、折叠屏新机mate x7系列以及nova 15系列,而pura 90系列则将成为2026年上…

    2025年12月6日 行业动态
    100
  • Linux如何防止缓冲区溢出_Linux防止缓冲区溢出的安全措施

    缓冲区溢出可通过栈保护、ASLR、NX bit、安全编译选项和良好编码实践来防范。1. 使用-fstack-protector-strong插入canary检测栈破坏;2. 启用ASLR(kernel.randomize_va_space=2)随机化内存布局;3. 利用NX bit标记不可执行内存页…

    2025年12月6日 运维
    000
  • Linux如何优化系统性能_Linux系统性能优化的实用方法

    优化Linux性能需先监控资源使用,通过top、vmstat等命令分析负载,再调整内核参数如TCP优化与内存交换,结合关闭无用服务、选用合适文件系统与I/O调度器,持续按需调优以提升系统效率。 Linux系统性能优化的核心在于合理配置资源、监控系统状态并及时调整瓶颈环节。通过一系列实用手段,可以显著…

    2025年12月6日 运维
    000
  • Pboot插件数据库连接的配置教程_Pboot插件数据库备份的自动化脚本

    首先配置PbootCMS数据库连接参数,确保插件正常访问;接着创建auto_backup.php脚本实现备份功能;然后通过Windows任务计划程序或Linux Cron定时执行该脚本,完成自动化备份流程。 如果您正在开发或维护一个基于PbootCMS的网站,并希望实现插件对数据库的连接配置以及自动…

    2025年12月6日 软件教程
    000
  • Linux命令行中wc命令的实用技巧

    wc命令可统计文件的行数、单词数、字符数和字节数,常用-l统计行数,如wc -l /etc/passwd查看用户数量;结合grep可分析日志,如grep “error” logfile.txt | wc -l统计错误行数;-w统计单词数,-m统计字符数(含空格换行),-c统计…

    2025年12月6日 运维
    000
  • Linux命令行中fc命令的使用方法

    fc 是 Linux 中用于管理命令历史的工具,可查看、编辑并重新执行历史命令。输入 fc 直接编辑最近一条命令,默认调用 $EDITOR 打开编辑器修改后自动执行;通过 fc 100 110 或 fc -5 -1 可批量编辑指定范围的历史命令,保存后按序重跑;使用 fc -l 列出命令历史,支持起…

    2025年12月6日 运维
    000
  • 曝小米17 Air正在筹备 超薄机身+2亿像素+eSIM技术?

    近日,手机行业再度掀起超薄机型热潮,三星与苹果已相继推出s25 edge与iphone air等轻薄旗舰,引发市场高度关注。在此趋势下,多家国产厂商被曝正积极布局相关技术,加速抢占这一细分赛道。据业内人士消息,小米的超薄旗舰机型小米17 air已进入筹备阶段。 小米17 Pro 爆料显示,小米正在评…

    2025年12月6日 行业动态
    000
  • 荣耀手表5Pro 10月23日正式开启首销国补优惠价1359.2元起售

    荣耀手表5pro自9月25日开启全渠道预售以来,市场热度持续攀升,上市初期便迎来抢购热潮,一度出现全线售罄、供不应求的局面。10月23日,荣耀手表5pro正式迎来首销,提供蓝牙版与esim版两种选择。其中,蓝牙版本的攀登者(橙色)、开拓者(黑色)和远航者(灰色)首销期间享受国补优惠价,到手价为135…

    2025年12月6日 行业动态
    000
  • VSCode终端美化:功率线字体配置

    首先需安装Powerline字体如Nerd Fonts,再在VSCode设置中将terminal.integrated.fontFamily设为’FiraCode Nerd Font’等支持字体,最后配合oh-my-zsh的powerlevel10k等Shell主题启用完整美…

    2025年12月6日 开发工具
    000
  • Linux命令行中locate命令的快速查找方法

    locate命令通过查询数据库快速查找文件,使用-i可忽略大小写,-n限制结果数量,-c统计匹配项,-r支持正则表达式精确匹配,刚创建的文件需运行sudo updatedb更新数据库才能查到。 在Linux命令行中,locate 命令是快速查找文件和目录路径的高效工具。它不直接扫描整个文件系统,而是…

    2025年12月6日 运维
    000
  • 环境搭建docker环境下如何快速部署mysql集群

    使用Docker Compose部署MySQL主从集群,通过配置文件设置server-id和binlog,编写docker-compose.yml定义主从服务并组网,启动后创建复制用户并配置主从连接,最后验证数据同步是否正常。 在Docker环境下快速部署MySQL集群,关键在于合理使用Docker…

    2025年12月6日 数据库
    000
  • Linux文件系统rsync命令详解

    rsync通过增量同步高效复制文件,支持本地及远程同步,常用选项包括-a、-v、-z和–delete,结合SSH可安全传输数据,配合cron可实现定时备份。 rsync 是 Linux 系统中一个非常强大且常用的文件同步工具,能够高效地在本地或远程系统之间复制和同步文件与目录。它以“增量…

    2025年12月6日 运维
    000
  • Linux systemctl list-dependencies命令详解

    systemctl list-dependencies 用于查看 systemd 单元的依赖关系,帮助排查启动问题和优化启动流程。1. 基本语法为 systemctl list-dependencies [选项] [单元名称],默认显示 default.target 的依赖。2. 常见单元类型包括 …

    2025年12月6日 运维
    100

发表回复

登录后才能评论
关注微信