2013年10月9日星期三

從MySQL 5.6至5.6 Percona的移動

Original post: http://anothermysqldba.blogspot.com/2013/10/moving-from-mysql-56-to-percona-56.html

Percona的5.6最近被釋放 (今天早些時候這篇文章的時候)。 因此,作為簡單的例子,什麼都沒有採取這種“更換下降嗎?”

Oct 7 06:47 Percona-Server-56-debuginfo-5.6.13-rel61.0.461.rhel6.x86_64.rpm
Oct 7 06:47 Percona-Server-client-56-5.6.13-rel61.0.461.rhel6.x86_64.rpm
Oct 7 06:47 Percona-Server-devel-56-5.6.13-rel61.0.461.rhel6.x86_64.rpm
Oct 7 06:47 Percona-Server-server-56-5.6.13-rel61.0.461.rhel6.x86_64.rpm
Oct 7 06:47 Percona-Server-shared-56-5.6.13-rel61.0.461.rhel6.x86_64.rpm

Oct 7 06:47 Percona-Server-test-56-5.6.13-rel61.0.461.rhel6.x86_64.rpm
# rpm -qa | grep MySQL
MySQL-server-5.6.13-1.el6.x86_64
MySQL-devel-5.6.13-1.el6.x86_64
MySQL-shared-compat-5.6.13-1.el6.x86_64
perl-DBD-MySQL-4.013-3.el6.x86_64
MySQL-python-1.2.3-0.3.c1.1.el6.x86_64
MySQL-client-5.6.13-1.el6.x86_64
MySQL-shared-5.6.13-1.el6.x86_64
MySQL-test-5.6.13-1.el6.x86_64


# rpm -Uhv *.rpm

雖然這將是很好的能夠移動從MySQL到Percona的這樣一個簡單的命令,你會得到衝突,如果你試過。

Percona-Server-server-56-5.6.13-rel61.0.461.rhel6.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64

因此,你必須做到以下幾點。

你應該已經有備份,但以防萬一,創造一個又一個。

一個非常簡單的例子下面Xtrabackup
innobackupex ./

  • 關閉MySQL的
  • 刪除軟件包
  • 安裝Percona的
  • 啟動和連接。

# /etc/init.d/mysql stop
Shutting down MySQL.. [ OK ]

# rpm -e MySQL-server MySQL-devel MySQL-client MySQL-shared MySQL-test mysql-workbench-community

# rpm -ihv Percona-Server-*.rpm
Preparing... ####################################### [100%]
1:Percona-Server-shared-5################################### [ 17%]
2:Percona-Server-client-5#################################### [ 33%]
3:Percona-Server-server-5################################### [ 50%]
Percona Server is distributed with several useful UDF (User Defined Function) from Maatkit.
Run the following commands to create these functions:
mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'"
mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'"
mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'"
See http://code.google.com/p/maatkit/source/browse/trunk/udf for more details
4:Percona-Server-test-56 ###################################### [ 67%]
5:Percona-Server-devel-56###################################### [ 83%]
6:Percona-Server-56-debug##################################### [100%]
[root@centos64 Percona]# /etc/init.d/m
mdmonitor memcached messagebus mysql mysqld
[root@centos64 Percona]# /etc/init.d/mysql start
Starting MySQL (Percona Server)............... [ OK ]

# mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'"

# mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'"
# mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'"

#mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.13-56-log Percona Server (GPL), Release rel61.0, Revision 461

Copyright (c) 2009-2013 Percona LLC and/or its affiliates
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

您現在Percona的5.6自由探索。