読者です 読者をやめる 読者になる 読者になる

DRY

Web関連の技術の事、食事/お酒の事、旅行の事など

CentOS5.6にyumでMySQLの最新をインストールする方法

CentOS5.6のインストール直後に普通にyumMySQLをインストールしようとすると、古いバージョン(5.0.77)がインストール
されてしまうので、これをMySQL5.5系のインストールに変更する方法

# yum info mysql
Available Packages
Name : mysql
Arch : i386
Version : 5.0.77
Release : 4.el5_6.6

Name : mysql
Arch : x86_64
Version : 5.0.77
Release : 4.el5_6.6

だもんで、Remiリポジトリの依存関係を追加して、インストール


# rpm -ivh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
# yum --enablerepo=remi,eplp install mysql-server

====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
mysql-server x86_64 5.5.13-1.el5.remi remi 12 M
Installing for dependencies:
mysql x86_64 5.5.13-1.el5.remi remi 7.4 M
mysql-libs x86_64 5.5.13-1.el5.remi remi 1.1 M
mysqlclient15 x86_64 5.0.67-1.el5.remi remi 1.3 M
perl-DBD-MySQL x86_64 3.0007-2.el5 base 148 k

Transaction Summary
====================================================================================================

一応起動確認でもしておくか。


# /etc/rc.d/init.d/mysqld start
Initializing MySQL database: WARNING: The host '***' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h *** password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

[ OK ]
Starting mysqld: [ OK ]
# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.13 MySQL Community Server (GPL) by Remi

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>