MYSQL5.5.27がリリースされていたのでバージョンアップ

D.1.2. Changes in MySQL 5.5.27 (2012-08-02)
http://dev.mysql.com/doc/refman/5.5/en/news-5-5-27.html

InnoDB、Partitioning、Replicationなどに関するBug Fixなど。
その他以下のように、YEAR(2)対応が含まれているようです。
Important Change: The YEAR(2) data type is now deprecated because it is problematic.
Support for YEAR(2) will be removed in a future release of MySQL.

1) MYSQLバックアップ

[root@aws ec2-user]# mysqldump --all-databases --single-transaction --flush-logs > /home/ec2-user/mysql_dump20120826.sql  -u root -p
Enter password:
[root@aws ec2-user]# ls -l mysql_dump20120826.sql
-rw-r--r-- 1 root root 1100643 Aug 26 12:00 mysql_dump20120826.sql

2)ダウンロードと展開
[root@aws src]# tar zxvf mysql-5.5.27-linux2.6-x86_64.tar.gz

[省略…]

[root@aws src]# mv mysql-5.5.27-linux2.6-x86_64 /usr/local/
[root@aws src]# ls -l /usr/local/
total 48
drwxr-xr-x 2 root root 4096 May 27 09:00 bin
drwxr-xr-x 2 root root 4096 Jan 6 2012 etc
drwxr-xr-x 2 root root 4096 Jan 6 2012 games
drwxr-xr-x 3 root root 4096 May 27 09:00 include
drwxr-xr-x 2 root root 4096 May 26 23:12 lib
drwxr-xr-x 3 root root 4096 Mar 24 17:06 lib64
drwxr-xr-x 2 root root 4096 Jan 6 2012 libexec
lrwxrwxrwx 1 root root 30 Jul 7 00:30 mysql -> mysql-5.5.25a-linux2.6-x86_64/
drwxrwxr-x 13 mysql mysql 4096 Jul 7 04:44 mysql-5.5.25a-linux2.6-x86_64
drwxr-xr-x 13 root root 4096 Aug 26 12:03 mysql-5.5.27-linux2.6-x86_64
drwxr-xr-x 2 root root 4096 Jan 6 2012 sbin
drwxr-xr-x 6 root root 4096 Mar 24 17:06 share
drwxr-xr-x 2 root root 4096 Aug 26 12:04 src
[root@aws src]#

3)サービス停止→データコピー→シンボリックリンク張り直し

[root@aws local]# /etc/init.d/mysqld stop
Stopping mysqld: [ OK ]
[root@aws local]#

[root@aws local]# ls -l
total 48
drwxr-xr-x 2 root root 4096 May 27 09:00 bin
drwxr-xr-x 2 root root 4096 Jan 6 2012 etc
drwxr-xr-x 2 root root 4096 Jan 6 2012 games
drwxr-xr-x 3 root root 4096 May 27 09:00 include
drwxr-xr-x 2 root root 4096 May 26 23:12 lib
drwxr-xr-x 3 root root 4096 Mar 24 17:06 lib64
drwxr-xr-x 2 root root 4096 Jan 6 2012 libexec
lrwxrwxrwx 1 root root 30 Jul 7 00:30 mysql -> mysql-5.5.25a-linux2.6-x86_64/
drwxrwxr-x 13 mysql mysql 4096 Jul 7 04:44 mysql-5.5.25a-linux2.6-x86_64
drwxr-xr-x 13 root root 4096 Aug 26 12:07 mysql-5.5.27-linux2.6-x86_64
drwxr-xr-x 2 root root 4096 Jan 6 2012 sbin
drwxr-xr-x 6 root root 4096 Mar 24 17:06 share
drwxr-xr-x 2 root root 4096 Aug 26 12:04 src
[root@aws local]#

[root@aws local]# cp -rp /usr/local/mysql/data/ /usr/local/mysql-5.5.27-linux2.6-x86_64
[root@aws local]# rm mysql
rm: remove symbolic link `mysql’? y
[root@aws local]# ln -s /usr/local/mysql-5.5.27-linux2.6-x86_64 mysql
[root@aws local]#

[root@aws local]# ls -l
total 48
drwxr-xr-x 2 root root 4096 May 27 09:00 bin
drwxr-xr-x 2 root root 4096 Jan 6 2012 etc
drwxr-xr-x 2 root root 4096 Jan 6 2012 games
drwxr-xr-x 3 root root 4096 May 27 09:00 include
drwxr-xr-x 2 root root 4096 May 26 23:12 lib
drwxr-xr-x 3 root root 4096 Mar 24 17:06 lib64
drwxr-xr-x 2 root root 4096 Jan 6 2012 libexec
lrwxrwxrwx 1 root root 39 Aug 26 12:09 mysql -> /usr/local/mysql-5.5.27-linux2.6-x86_64
drwxrwxr-x 13 mysql mysql 4096 Jul 7 04:44 mysql-5.5.25a-linux2.6-x86_64
drwxr-xr-x 14 root root 4096 Aug 26 12:09 mysql-5.5.27-linux2.6-x86_64
drwxr-xr-x 2 root root 4096 Jan 6 2012 sbin
drwxr-xr-x 6 root root 4096 Mar 24 17:06 share
drwxr-xr-x 2 root root 4096 Aug 26 12:04 src
[root@aws local]#

Symbolic Link

4)権限設定
[root@aws local]# chown -R mysql:mysql mysql-5.5.27-linux2.6-x86_64
[root@aws local]#

5)新しいバイナリーでサービスの起動
[root@aws data]# /etc/init.d/mysqld start
Starting mysqld: [ OK ]
[root@aws data]#

6)MYSQL_UPGRADEの実行とシステムテーブルの更新
[root@aws bin]# /usr/local/mysql/bin/mysql_upgrade -u root -p
Enter password:
Looking for ‘mysql’ as: /usr/local/mysql/bin/mysql
Looking for ‘mysqlcheck’ as: /usr/local/mysql/bin/mysqlcheck
Running ‘mysqlcheck’ with connection arguments: ‘–port=3306’ ‘–socket=/usr/local/mysql/data/mysql.sock’
Running ‘mysqlcheck’ with connection arguments: ‘–port=3306’ ‘–socket=/usr/local/mysql/data/mysql.sock’
WP01.wp01_commentmeta OK
WP01.wp01_comments OK
WP01.wp01_geo_mashup_administrative_names OK
WP01.wp01_geo_mashup_location_relationships OK
WP01.wp01_geo_mashup_locations OK
WP01.wp01_links OK
WP01.wp01_mappress_maps OK
WP01.wp01_mappress_posts OK
WP01.wp01_options OK
WP01.wp01_postmeta OK
WP01.wp01_posts OK
WP01.wp01_searchmeter OK
WP01.wp01_searchmeter_recent OK
WP01.wp01_term_relationships OK
WP01.wp01_term_taxonomy OK
WP01.wp01_terms OK
WP01.wp01_usermeta OK
WP01.wp01_users OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Running ‘mysql_fix_privilege_tables’…
OK
[root@aws bin]#

7)バージョンの確認
[root@aws data]# cat mysql_upgrade_info
5.5.27
[root@aws data]#

5.5.27

参考サイト:
D.1.2. Changes in MySQL 5.5.27 (2012-08-02)

Comments are closed.

Post Navigation