2015년 1월 15일 목요일

CentOS MySQL 업그레이드 5.1 to 5.5

- 버전 확인

[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)


- 설치된 mysql 확인

[root@localhost ~]# yum list installed | grep -i mysql
MySQL-python.x86_64  1.2.3-0.3.c1.1.el6 @base
mysql.x86_64         5.1.73-3.el6_5     @base
mysql-libs.x86_64    5.1.73-3.el6_5     @base
mysql-server.x86_64  5.1.73-3.el6_5     @base
perl-DBD-MySQL.x86_64
php-mysql.x86_64     5.3.3-40.el6_6     @updates


- mysql 중지

[root@localhost ~]# service mysqld stop



- 백업

[root@localhost ~]# cp /etc/my.cnf /etc/my.cnf.5.1
[root@localhost ~]# cp -R /var/lib/mysql /var/lib/mysql.5.1 // 복구하는 경우 권한 주의


- reposiroey 추가

## 이미 추가 되어 있을 수 있다 ##
[root@localhost ~]# rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm 

## Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 ##
[root@localhost ~]# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
 ## CentOS 6 and Red Hat (RHEL) 6 ##
[root@localhost ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm


- mysql 제거

[root@localhost ~]# yum remove mysql mysql-*

. . . 

Removed:
  mysql.x86_64 0:5.1.73-3.el6_5               
  mysql-libs.x86_64 0:5.1.73-3.el6_5               
  mysql-server.x86_64 0:5.1.73-3.el6_5

Dependency Removed:
  MySQL-python.x86_64 0:1.2.3-0.3.c1.1.el6            
  perl-DBD-MySQL.x86_64 0:4.013-3.el6            
  php-mysql.x86_64 0:5.3.3-40.el6_6



- libmysqlclient16 설치

[root@localhost ~]# yum install libmysqlcliecnt16 --enablerepo=webtatic



- mysql 5.5 설치

[root@localhost ~]# yum install mysql mysql-server --enablerepo=remi


Installed:
  mysql.x86_64 0:5.5.41-1.el6.remi                           
  mysql-server.x86_64 0:5.5.41-1.el6.remi

Dependency Installed:
  compat-mysql51.x86_64 0:5.1.54-1.el6.remi    
  mysql-libs.x86_64 0:5.5.41-1.el6.remi    
  perl-DBD-MySQL.x86_64 0:4.013-3.el6



- mysql 5.1 삭제된 package 설치

[root@localhost ~]# yum install MySQL-python
[root@localhost ~]# yum install php-mysql



- mysql 시작 및 업그레이드

[root@localhost ~]# /etc/init.d/mysqld start
[root@localhost ~]# /usr/bin/mysql_upgrade -u root -p


- mysql 재 시작

[root@localhost ~]# service mysqld restart

댓글 없음:

댓글 쓰기