MySQL5とPHP5をバージョンアップ
MySQLとPHPのバージョンを確認
[root@centos ~]# mysql --version
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1 ←確認
[root@centos ~]# php -v
PHP 5.1.6 (cli) (built: Nov 29 2010 16:47:46) ←確認
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
MySQLとPHPをアップデート
[root@centos ~]# yum -y update --enablerepo=remi mysql* php*
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
mysql x86_64 5.5.11-1.el5.remi remi 7.4 M
mysql-server x86_64 5.5.11-1.el5.remi remi 12 M
php x86_64 5.3.6-3.el5.remi remi 1.4 M
php-cli x86_64 5.3.6-3.el5.remi remi 2.6 M
php-common x86_64 5.3.6-3.el5.remi remi 973 k
php-mbstring x86_64 5.3.6-3.el5.remi remi 2.3 M
php-mcrypt x86_64 5.3.6-3.el5.remi remi 47 k
php-mysql x86_64 5.3.6-3.el5.remi remi 159 k
php-pdo x86_64 5.3.6-3.el5.remi remi 117 k
Installing for dependencies:
libedit x86_64 20090923-3.0_1.el5.rf rpmforge 272 k
libtool-ltdl x86_64 1.5.22-7.el5_4 base 38 k
mysql-libs x86_64 5.5.11-1.el5.remi remi 1.1 M
mysqlclient15 x86_64 5.0.67-1.el5.remi remi 1.3 M
Transaction Summary
================================================================================
Install 4 Package(s)
Upgrade 9 Package(s)
Total download size: 30 M
Downloading Packages:
(1/13): libtool-ltdl-1.5.22-7.el5_4.x86_64.rpm | 38 kB 00:00
(2/13): php-mcrypt-5.3.6-3.el5.remi.x86_64.rpm | 47 kB 00:00
(3/13): php-pdo-5.3.6-3.el5.remi.x86_64.rpm | 117 kB 00:00
(4/13): php-mysql-5.3.6-3.el5.remi.x86_64.rpm | 159 kB 00:00
(5/13): libedit-20090923-3.0_1.el5.rf.x86_64.rpm | 272 kB 00:02
(6/13): php-common-5.3.6-3.el5.remi.x86_64.rpm | 973 kB 00:07
(7/13): mysql-libs-5.5.11-1.el5.remi.x86_64.rpm | 1.1 MB 00:08
(8/13): mysqlclient15-5.0.67-1.el5.remi.x86_64.rpm | 1.3 MB 00:19
(9/13): php-5.3.6-3.el5.remi.x86_64.rpm | 1.4 MB 00:12
(10/13): php-mbstring-5.3.6-3.el5.remi.x86_64.rpm | 2.3 MB 00:17
(11/13): php-cli-5.3.6-3.el5.remi.x86_64.rpm | 2.6 MB 00:26
(12/13): mysql-5.5.11-1.el5.remi.x86_64.rpm | 7.4 MB 00:53
(13/13): mysql-server-5.5.11-1.el5.remi.x86_64.rpm | 12 MB 01:29
--------------------------------------------------------------------------------
Total 124 kB/s | 30 MB 04:03
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
WARNING : This php-* RPM are not official Fedora/Redhat build and
overrides the official ones. Don't file bugs on Fedora Project nor Redhat.
Use dedicated forums http://forums.famillecollet.com/
Updating : php-common 1/22
warning: /etc/php.ini created as /etc/php.ini.rpmnew
Installing : mysqlclient15 2/22
WARNING : This MySQL RPM is not an official Fedora/Redhat build and it
overrides the official one. Don't file bugs on Fedora Project nor Redhat.
Use dedicated forums http://forums.famillecollet.com/
Installing : mysql-libs 3/22
warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
Updating : php-pdo 4/22
Updating : mysql 5/22
Installing : libedit 6/22
Updating : php-cli 7/22
Updating : php 8/22
Installing : libtool-ltdl 9/22
Updating : php-mbstring 10/22
Updating : php-mysql 11/22
Updating : php-mcrypt 12/22
Updating : mysql-server 13/22
Cleanup : php 14/22
Cleanup : php-cli 15/22
Cleanup : php-mbstring 16/22
Cleanup : mysql 17/22
Cleanup : php-mysql 18/22
Cleanup : php-mcrypt 19/22
Cleanup : php-common 20/22
Cleanup : php-pdo 21/22
Cleanup : mysql-server 22/22
Dependency Installed:
libedit.x86_64 0:20090923-3.0_1.el5.rf
libtool-ltdl.x86_64 0:1.5.22-7.el5_4
mysql-libs.x86_64 0:5.5.11-1.el5.remi
mysqlclient15.x86_64 0:5.0.67-1.el5.remi
Updated:
mysql.x86_64 0:5.5.11-1.el5.remi mysql-server.x86_64 0:5.5.11-1.el5.remi
php.x86_64 0:5.3.6-3.el5.remi php-cli.x86_64 0:5.3.6-3.el5.remi
php-common.x86_64 0:5.3.6-3.el5.remi php-mbstring.x86_64 0:5.3.6-3.el5.remi
php-mcrypt.x86_64 0:5.3.6-3.el5.remi php-mysql.x86_64 0:5.3.6-3.el5.remi
php-pdo.x86_64 0:5.3.6-3.el5.remi
Complete!
my.cnf編集 再起動 アップグレード
[root@centos ~]# vi /etc/my.cnf
[mysqld]
default-character-set=utf8
↓
character-set-server=utf8 ←変更
#[mysql]
#default-character-set = utf8 ←コメントアウト
[root@centos ~]# /etc/rc.d/init.d/mysqld restart
[root@centos ~]# mysql_upgrade -u root -p
Enter password: ←MySQLのrootパスワードを入力
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
Running 'mysqlcheck with default connection arguments
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.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
apache再起動
[root@centos ~]# /etc/rc.d/init.d/httpd restart
MySQLとPHPのバージョンを確認
[root@centos ~]# mysql --version
mysql Ver 14.14 Distrib 5.5.11, for Linux (x86_64) using readline 5.1 ←確認
[root@centos ~]# php -v
PHP 5.3.6 (cli) (built: Apr 15 2011 18:11:25) ←確認
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies