centos6.9升級mysql5.1到mysql5.6
阿新 • • 發佈:2017-09-15
升級 mysql
一:查看下是否有系統自帶MySQL的rpm包,如果有,需要刪除自帶的舊rpm包。
[[email protected] mnt]# mysql -V mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1 [[email protected] mnt]# rpm -qa | grep -i mysql 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 [[email protected] mnt]# yum remove mysql*
二:在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
[[email protected] /mnt]#wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm [[email protected] /mnt]#wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm [[email protected] /mnt]#wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm
報錯:
wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm --2017-09-14 17: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 請求,正在等待回應... 301 Moved Permanently 位置:https://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm [跟隨至新的 URL] --2017-09-14 17: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’。
所以添加提示參數:
[[email protected] /mnt]#wget --no-check-certificate http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm [[email protected] /mnt]#wget --no-check-certificate http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm [[email protected] /mnt]#wget --no-check-certificate http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm
三:啟動mysql,報錯
[[email protected] opt]# service mysql restart ERROR! MySQL server PID file could not be found! Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.pid).
本次解決方法:
cd /var/lib/mysql
rm -rf ibdata1 ib_logfile1 ib_logfile0
此時:
service mysql restart Shutting down MySQL.. SUCCESS! Starting MySQL. SUCCESS!
根據http://www.jb51.net/article/48625.htm博文,也有其他解決方案
centos6.9升級mysql5.1到mysql5.6