centos6.9升级mysql5.1到mysql5.6

前端之家收集整理的这篇文章主要介绍了centos6.9升级mysql5.1到mysql5.6前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

一:查看下是否有系统自带MysqL的rpm包,如果有,需要删除自带的旧rpm包。

[root@localhostmnt]#MysqL-V
MysqLVer14.14Distrib5.1.73,forredhat-linux-gnu(x86_64)usingreadline5.1
[root@localhostmnt]#rpm-qa|grep-iMysqL
MysqL-server-5.1.73-8.el6_8.x86_64
MysqL-5.1.73-8.el6_8.x86_64
MysqL-devel-5.1.73-8.el6_8.x86_64
MysqL-libs-5.1.73-8.el6_8.x86_64
perl-DBD-MysqL-4.013-3.el6.x86_64
[root@localhostmnt]#yumremoveMysqL*

二:MysqL官网下载安装MysqL-5.6.21所需的rpm软件包。
需要下载三个rpm软件包:
MysqL-client-5.6.21-1.rhel5.x86_64.rpm

MysqL-devel-5.6.21-1.rhel5.x86_64.rpm

MysqL-server-5.6.21-1.rhel5.x86_64.rpm

[root@linuxidc/mnt]#wgethttp://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-server-5.6.21-1.rhel5.x86_64.rpm
[root@linuxidc/mnt]#wgethttp://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-devel-5.6.21-1.rhel5.x86_64.rpm
[root@linuxidc/mnt]#wgethttp://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-client-5.6.21-1.rhel5.x86_64.rpm

报错:

wgethttp://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-server-5.6.21-1.rhel5.x86_64.rpm
--2017-09-1417:07:49--http://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-server-5.6.21-1.rhel5.x86_64.rpm
正在解析主机dev.MysqL.com...137.254.60.11
正在连接dev.MysqL.com|137.254.60.11|:80...已连接。
已发出HTTP请求,正在等待回应...301MovedPermanently
位置:https://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-server-5.6.21-1.rhel5.x86_64.rpm[跟随至新的URL]
--2017-09-1417:07:50--https://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-server-5.6.21-1.rhel5.x86_64.rpm
正在连接dev.MysqL.com|137.254.60.11|:443...已连接。
错误:证书通用名“www.MysqL.com”与所要求的主机名“dev.MysqL.com”不符。
要以不安全的方式连接至dev.MysqL.com,使用‘--no-check-certificate’。

所以添加提示参数:

[root@linuxidc/mnt]#wget--no-check-certificatehttp://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-server-5.6.21-1.rhel5.x86_64.rpm
[root@linuxidc/mnt]#wget--no-check-certificatehttp://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-devel-5.6.21-1.rhel5.x86_64.rpm
[root@linuxidc/mnt]#wget--no-check-certificatehttp://dev.MysqL.com/Downloads/MysqL-5.6/MysqL-client-5.6.21-1.rhel5.x86_64.rpm

然后安装:

[root@localhost~]#rpm-ivhMysqL-client-5.6.21-1.rhel5.x86_64.rpm
Preparing...###########################################[100%]
1:MysqL-client###########################################[100%]
[root@localhost~]#rpm-ivhMysqL-devel-5.6.21-1.rhel5.x86_64.rpm
Preparing...###########################################[100%]
1:MysqL-devel###########################################[100%]
[root@localhost~]#rpm-ivhMysqL-server-5.6.21-1.rhel5.x86_64.rpm
error:Faileddependencies:
	libaio.so.1()(64bit)isneededbyMysqL-server-5.6.21-1.rhel5.x86_64
	libaio.so.1(LIBAIO_0.1)(64bit)isneededbyMysqL-server-5.6.21-1.rhel5.x86_64
	libaio.so.1(LIBAIO_0.4)(64bit)isneededbyMysqL-server-5.6.21-1.rhel5.x86_64

报错:按着提示,继续安装libaio库
	
[root@localhost~]#yuminstalllibaio



三:启动MysqL,报错

[root@localhostopt]#serviceMysqLrestart
ERROR!MysqLserverPIDfilecouldnotbefound!
StartingMysqL.ERROR!TheserverquitwithoutupdatingPIDfile(/var/lib/MysqL/localhost.pid).

本次解决方法

cd /var/lib/MysqL

rm -rf ibdata1 ib_logfile1 ib_logfile0

此时:

serviceMysqLrestart
ShuttingdownMysqL..SUCCESS!
StartingMysqL.SUCCESS!

根据http://www.jb51.net/article/48625.htm博文,也有其他解决方案

原文链接:https://www.f2er.com/centos/375883.html

猜你在找的CentOS相关文章