Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
4
Help us understand the problem. What is going on with this article?
@tkprof

How to upgrade MySQL 5.1 to 5.7

More than 3 years have passed since last update.

Update :exclamation:

  • How to update yum repository mysql57-community-dmr --> mysql57-community

With mysql57-community-dmr installed, Conflict error occurs like

yum install http://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm

Setting up Install Process
mysql57-community-release-el6-11.noarch.rpm                                                                  |  25 kB     00:00     
Examining /var/tmp/yum-root-dWCjk3/mysql57-community-release-el6-11.noarch.rpm: mysql57-community-release-el6-11.noarch
Marking /var/tmp/yum-root-dWCjk3/mysql57-community-release-el6-11.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch 0:el6-11 will be installed
--> Processing Conflict: mysql57-community-release-el6-11.noarch conflicts mysql-community-release
No package matched to upgrade: mysql57-community-release
--> Finished Dependency Resolution
Error: mysql57-community-release conflicts with mysql-community-release-el6-7.noarch
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
  • Fix
yum-config-manager --disable mysql57-community-dmr

yum remove mysql-community-release-el6-7.noarch
yum install http://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm

yum-config-manager --enable mysql57-community

Background

  • Conoha Ruby on Rails template uses MySQL 5.1 as of March 2016
  • needs to be upgraded to the latest version MySQL 5.7 quickly !

Plan

Preliminary

【シンプル】CentOS6にMySQL5.7をyumで簡単にインストールする手順

http://blog.ybbo.net/2015/03/11/how-to-install-mysql5-7-to-centos6-using-yum/

Steps - How to upgrade

Environment

  • CentOS 6.7 installed (Red Hat Enterprise Linux Server 6.7)
/etc/issue
CentOS release 6.7 (Final)

yum repository for CentOS 6.x

yum install http://dev.mysql.com/get/mysql-community-release-el6-11.noarch.rpm

shutdown MySQL 5.1 for upgrade

mysql -u root -ppassword --execute="set global innodb_fast_shutdown=0"
mysqladmin -u root -ppassword shutdown

upgrade to MySQL 5.5

yum-config-manager --disable mysql56-community
yum-config-manager --enable mysql55-community
yum update mysql mysql-devel mysql-server mysql-utilities

mysqld_safe && mysql_upgrade - 5.5

mysqld_safe
mysql_upgrade -u root -ppassword
service mysqld stop

upgrade to MySQL 5.6

yum-config-manager --disable mysql55-community
yum-config-manager --enable mysql56-community
yum update mysql mysql-devel mysql-server mysql-utilities

mysqld_safe && mysql_upgrade - 5.6

mysqld_safe
mysql_upgrade -u root -ppassword
service mysqld stop

upgrade to MySQL 5.7 :exclamation:

yum-config-manager --disable mysql56-community
yum-config-manager --enable mysql57-community
yum update mysql mysql-devel mysql-server mysql-utilities

mysqld_safe && mysql_upgrade - 5.7

mysqld_safe
mysql_upgrade -u root -ppassword
service mysqld stop

Fin

mysql --version
mysql  Ver 14.14 Distrib 5.7.12, for Linux (x86_64)

Done :smiley: :tada:

4
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
tkprof

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
4
Help us understand the problem. What is going on with this article?