バージョン確認

[root@HOME002 src]# /usr/local/mysql/bin/mysql --version
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.6.13, for linux-glibc2.5 (i686) using  EditLine wrapper
[root@HOME002 src]#

ダウンロード

[root@HOME002 src]# wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-i686.tar.gz/from/http://cdn.mysql.com/
--09:30:09--  http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-i686.tar.gz/from/http://cdn.mysql.com/
dev.mysql.com をDNSに問いあわせています... 137.254.60.11
dev.mysql.com|137.254.60.11|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-i686.tar.gz [続く]
--09:30:10--  http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-i686.tar.gz
cdn.mysql.com をDNSに問いあわせています... 23.209.216.96
cdn.mysql.com|23.209.216.96|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 299497357 (286M) [application/x-tar-gz]
Saving to: `mysql-5.6.14-linux-glibc2.5-i686.tar.gz'

100%[=====================================================================================================>] 299,497,357 1.12M/s   in 4m 43s

09:34:53 (1.01 MB/s) - `mysql-5.6.14-linux-glibc2.5-i686.tar.gz' を保存しました [299497357/299497357]

[root@HOME002 src]#

■64bit版
———————————————————————————-
http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz/from/http://cdn.mysql.com/
http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz
———————————————————————————-

展開

[root@HOME002 src]# tar xzvf mysql-5.6.14-linux-glibc2.5-i686.tar.gz
mysql-5.6.14-linux-glibc2.5-i686/bin/innochecksum
mysql-5.6.14-linux-glibc2.5-i686/bin/myisam_ftdump
mysql-5.6.14-linux-glibc2.5-i686/bin/mysql_waitpid
mysql-5.6.14-linux-glibc2.5-i686/bin/mysqld_safe
mysql-5.6.14-linux-glibc2.5-i686/bin/perror
mysql-5.6.14-linux-glibc2.5-i686/bin/resolveip
mysql-5.6.14-linux-glibc2.5-i686/bin/msql2mysql
mysql-5.6.14-linux-glibc2.5-i686/bin/mysqlbinlog

省略...............

mysql-5.6.14-linux-glibc2.5-i686/support-files/mysqld_multi.server
mysql-5.6.14-linux-glibc2.5-i686/support-files/magic
mysql-5.6.14-linux-glibc2.5-i686/support-files/mysql-log-rotate
[root@HOME002 src]#

展開したファイルの移動

[root@HOME002 src]# ls -l
合計 585176
-rw-r--r--  1 root root 299105519  7月 12 20:17 mysql-5.6.13-linux-glibc2.5-i686.tar.gz
drwxr-xr-x 13 root root      4096 11月  9 10:06 mysql-5.6.14-linux-glibc2.5-i686
-rw-r--r--  1 root root 299497357  9月 11 11:14 mysql-5.6.14-linux-glibc2.5-i686.tar.gz
[root@HOME002 src]# mv mysql-5.6.14-linux-glibc2.5-i686 /usr/local/
[root@HOME002 src]#
[root@HOME002 local]# ls -l
合計 116
drwxr-xr-x  2 root  root  4096  1月  8  2013 bin
drwxr-xr-x  2 root  root  4096  3月 30  2007 etc
drwxr-xr-x  2 root  root  4096  3月 30  2007 games
drwxr-xr-x  2 root  root  4096  1月  7  2013 include
drwxr-xr-x  3 root  root  4096  1月  7  2013 lib
drwxr-xr-x  2 root  root  4096  3月 30  2007 libexec
drwxr-xr-x  3 root  root  4096  1月  7  2013 man
lrwxrwxrwx  1 root  root    33  9月 14 07:57 mysql -> mysql-5.6.13-linux-glibc2.5-i686/
drwxr-xr-x 13 mysql mysql 4096  4月 28  2013 mysql-5.6.11-linux-glibc2.5-i686
drwxr-xr-x 13 mysql mysql 4096  6月 22 10:09 mysql-5.6.12-linux-glibc2.5-i686
drwxr-xr-x 13 mysql mysql 4096  9月 14 07:48 mysql-5.6.13-linux-glibc2.5-i686
drwxr-xr-x 13 root  root  4096 11月  9 10:06 mysql-5.6.14-linux-glibc2.5-i686
drwxr-xr-x  2 root  root  4096  3月 30  2007 sbin
drwxr-xr-x  5 root  root  4096  1月  7  2013 share
drwxr-xr-x  2 root  root  4096 11月  9 10:06 src
[root@HOME002 local]#

データコピー前にDBを停止とシンボリックリンク削除
データコピー後に再開

[root@HOME002 local]# /etc/init.d/mysql stop
Shutting down MySQL...                                     [  OK  ]
[root@HOME002 local]# rm mysql
rm: remove シンボリックリンク `mysql'? y
[root@HOME002 local]#

[root@HOME002 mysql-5.6.13-linux-glibc2.5-i686]# cp -rp data/* /usr/local/mysql-5.6.14-linux-glibc2.5-i686/data/
cp: `/usr/local/mysql-5.6.14-linux-glibc2.5-i686/data/test/db.opt' を上書きしてもよろしいですか(yes/no)? y
[root@HOME002 mysql-5.6.13-linux-glibc2.5-i686]#

[root@HOME002 local]# chown -R mysql:mysql mysql-5.6.14-linux-glibc2.5-i686/
[root@HOME002 local]# chmod -R 755 mysql-5.6.14-linux-glibc2.5-i686/
[root@HOME002 local]# ln -s mysql-5.6.14-linux-glibc2.5-i686/ mysql
[root@HOME002 local]#

[root@HOME002 local]# ls -l
合計 116
drwxr-xr-x  2 root  root  4096  1月  8  2013 bin
drwxr-xr-x  2 root  root  4096  3月 30  2007 etc
drwxr-xr-x  2 root  root  4096  3月 30  2007 games
drwxr-xr-x  2 root  root  4096  1月  7  2013 include
drwxr-xr-x  3 root  root  4096  1月  7  2013 lib
drwxr-xr-x  2 root  root  4096  3月 30  2007 libexec
drwxr-xr-x  3 root  root  4096  1月  7  2013 man
lrwxrwxrwx  1 root  root    33 11月  9 10:12 mysql -> mysql-5.6.14-linux-glibc2.5-i686/
drwxr-xr-x 13 mysql mysql 4096  4月 28  2013 mysql-5.6.11-linux-glibc2.5-i686
drwxr-xr-x 13 mysql mysql 4096  6月 22 10:09 mysql-5.6.12-linux-glibc2.5-i686
drwxr-xr-x 13 mysql mysql 4096  9月 14 07:48 mysql-5.6.13-linux-glibc2.5-i686
drwxr-xr-x 13 mysql mysql 4096 11月  9 10:06 mysql-5.6.14-linux-glibc2.5-i686
drwxr-xr-x  2 root  root  4096  3月 30  2007 sbin
drwxr-xr-x  5 root  root  4096  1月  7  2013 share
drwxr-xr-x  2 root  root  4096 11月  9 10:06 src
[root@HOME002 local]#


[root@HOME002 local]# /etc/init.d/mysql start
Starting MySQL......                                       [  OK  ]
[root@HOME002 local]#

バージョン確認

[root@HOME002 local]#  /usr/local/mysql/bin/mysql --version
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.6.14, for linux-glibc2.5 (i686) using  EditLine wrapper
[root@HOME002 local]#

mysql> select @@version;
+------------+
| @@version  |
+------------+
| 5.6.14-log |
+------------+
1 row in set (0.00 sec)

mysql> use test
Database changed
mysql> select database();
+------------+
| database() |
+------------+
| test       |
+------------+
1 row in set (0.00 sec)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| TABLE001       |
| timestamp_chk  |
| timestamp_chk2 |
+----------------+
3 rows in set (0.00 sec)

mysql>

■ 暫くDBを立ち上げていなかったので、ログが削除されていてレプリケーションがエラーになっていたのでレプリケーション修正。


mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: home001
                  Master_User: slave_user
省略

Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 1236
                Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
   




mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000034 |      120 |              |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

mysql>



mysql> stop slave;
Query OK, 0 rows affected (0.08 sec)

mysql> CHANGE MASTER TO MASTER_HOST = 'home001', master_port=3306, MASTER_LOG_FILE = 'mysql-bin.000034', MASTER_LOG_POS = 120;
Query OK, 0 rows affected (0.17 sec)

mysql> start slave;
Query OK, 0 rows affected (0.06 sec)

mysql>


mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: home001
                  Master_User: slave_user
省略

Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:


mysql>  select @@hostname;
+---------------------+
| @@hostname          |
+---------------------+
| HOME001.localdomain |
+---------------------+
1 row in set (0.00 sec)

mysql> use test;
Database changed
mysql> insert into TABLE001(title,comment) values('after-upgrade','Master MYSQL is upgraded to 5.6.14.');
Query OK, 1 row affected (0.38 sec)


mysql> select * from TABLE001 order by id desc limit 0,1;
+----+---------------+-------------------------------------+
| id | title         | comment                             |
+----+---------------+-------------------------------------+
| 24 | after-upgrade | Master MYSQL is upgraded to 5.6.14. |
+----+---------------+-------------------------------------+
1 row in set (0.00 sec)

mysql>




mysql> select @@hostname;
+---------------------+
| @@hostname          |
+---------------------+
| HOME002.localdomain |
+---------------------+
1 row in set (0.00 sec)

mysql> select * from TABLE001 order by id desc limit 0,1;
+----+---------------+-------------------------------------+
| id | title         | comment                             |
+----+---------------+-------------------------------------+
| 24 | after-upgrade | Master MYSQL is upgraded to 5.6.14. |
+----+---------------+-------------------------------------+
1 row in set (0.00 sec)

mysql>