2/02/2015

update mysql 5.5 to 5.6 by yum on Centos

Now MySQL provides the repos for mysql-server (http://dev.mysql.com/downloads/repo/). So we may use it and install or update mysql.

1. Add repo for msyql
   # rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

2. View Repo of mysql
   #  less  /etc/yum.repos.d/mysql-community.repo


# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Note: MySQL 5.7 is currently in development. For use at your own risk.
# Please read with sub pages: https://dev.mysql.com/doc/relnotes/mysql/5.7/en/
[mysql57-community-dmr]
name=MySQL 5.7 Community Server Development Milestone Release
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=0

3. Back your database
  # msyqldump -uroot -p --databases database-name1 database-name2 > /tmp/backup.sql

4. Update your msyql
     # yum [install | update] mysql-server

5. Check the version of your mysql
    # mysql --version


   

No comments:

Post a Comment