hironomiu's Blog

こそっと書いていきます。twitter_id:hironomiu

mysql ScientificLinux 6でremiを使ってMySQL5.5のインストール

mysql remiを使ったインストール

epel remiをインストール

[root@localhost ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm を取得中
警告: /var/tmp/rpm-tmp.PadQj9: ヘッダ V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
準備中...                ########################################### [100%]
   1:epel-release           ########################################### [100%]
[root@localhost ~]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
http://rpms.famillecollet.com/enterprise/remi-release-6.rpm を取得中
警告: /var/tmp/rpm-tmp.dS6Bzq: ヘッダ V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
準備中...                ########################################### [100%]
   1:remi-release           ########################################### [100%]

/etc/yum.repos.d/remi.repoの$releseverを6に置換える

mysql mysql-serverのインストール(remiを指定)

[root@localhost ~]# yum install --enablerepo=remi mysql mysql-server
Loaded plugins: security
epel/metalink                                                                                                                                      |  19 kB     00:00     
epel                                                                                                                                               | 4.0 kB     00:00     
epel/primary_db                                                                                                                                    | 3.6 MB     00:41     
remi                                                                                                                                               | 2.9 kB     00:01     
remi/primary_db                                                                                                                                    | 249 kB     00:44     
sl                                                                                                                                                 | 3.2 kB     00:00     
sl-security                                                                                                                                        | 1.9 kB     00:00     
sl-security/primary_db                                                                                                                             | 2.2 MB     02:31     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql.i686 0:5.1.61-1.el6_2.1 will be updated
---> Package mysql.i686 0:5.5.23-1.el6.remi will be an update
--> Processing Dependency: mysql-libs(x86-32) = 5.5.23-1.el6.remi for package: mysql-5.5.23-1.el6.remi.i686
---> Package mysql-server.i686 0:5.5.23-1.el6.remi will be installed
--> Processing Dependency: perl-DBI for package: mysql-server-5.5.23-1.el6.remi.i686
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.5.23-1.el6.remi.i686
--> Processing Dependency: perl(DBI) for package: mysql-server-5.5.23-1.el6.remi.i686
--> Processing Dependency: libaio.so.1(LIBAIO_0.4) for package: mysql-server-5.5.23-1.el6.remi.i686
--> Processing Dependency: libaio.so.1(LIBAIO_0.1) for package: mysql-server-5.5.23-1.el6.remi.i686
--> Processing Dependency: libaio.so.1 for package: mysql-server-5.5.23-1.el6.remi.i686
--> Running transaction check
---> Package libaio.i686 0:0.3.107-10.el6 will be installed
---> Package mysql-libs.i686 0:5.1.61-1.el6_2.1 will be updated
--> Processing Dependency: libmysqlclient.so.16 for package: perl-DBD-MySQL-4.013-3.el6.i686
--> Processing Dependency: libmysqlclient.so.16 for package: php-mysql-5.3.3-3.el6_2.6.i686
--> Processing Dependency: libmysqlclient.so.16 for package: 2:postfix-2.6.6-2.2.el6_1.i686
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16) for package: perl-DBD-MySQL-4.013-3.el6.i686
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16) for package: php-mysql-5.3.3-3.el6_2.6.i686
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16) for package: 2:postfix-2.6.6-2.2.el6_1.i686
---> Package mysql-libs.i686 0:5.5.23-1.el6.remi will be an update
---> Package perl-DBD-MySQL.i686 0:4.013-3.el6 will be installed
---> Package perl-DBI.i686 0:1.609-4.el6 will be installed
--> Running transaction check
---> Package compat-mysql51.i686 0:5.1.54-1.el6.remi will be installed
---> Package php-mysql.i686 0:5.3.3-3.el6_2.6 will be updated
---> Package php-mysql.i686 0:5.3.10-2.el6.remi will be an update
--> Processing Dependency: php-pdo(x86-32) = 5.3.10-2.el6.remi for package: php-mysql-5.3.10-2.el6.remi.i686
--> Running transaction check
---> Package php-pdo.i686 0:5.3.3-3.el6_2.6 will be updated
---> Package php-pdo.i686 0:5.3.10-2.el6.remi will be an update
--> Processing Dependency: php-common(x86-32) = 5.3.10-2.el6.remi for package: php-pdo-5.3.10-2.el6.remi.i686
--> Running transaction check
---> Package php-common.i686 0:5.3.3-3.el6_2.6 will be updated
--> Processing Dependency: php-common = 5.3.3-3.el6_2.6 for package: php-zts-5.3.3-3.el6_2.6.i686
--> Processing Dependency: php-common = 5.3.3-3.el6_2.6 for package: php-gd-5.3.3-3.el6_2.6.i686
--> Processing Dependency: php-common = 5.3.3-3.el6_2.6 for package: php-cli-5.3.3-3.el6_2.6.i686
--> Processing Dependency: php-common = 5.3.3-3.el6_2.6 for package: php-5.3.3-3.el6_2.6.i686
--> Processing Dependency: php-common = 5.3.3-3.el6_2.6 for package: php-mbstring-5.3.3-3.el6_2.6.i686
--> Processing Dependency: php-common = 5.3.3-3.el6_2.6 for package: php-ldap-5.3.3-3.el6_2.6.i686
--> Processing Dependency: php-common = 5.3.3-3.el6_2.6 for package: php-xml-5.3.3-3.el6_2.6.i686
---> Package php-common.i686 0:5.3.10-2.el6.remi will be an update
--> Running transaction check
---> Package php.i686 0:5.3.3-3.el6_2.6 will be updated
---> Package php.i686 0:5.3.10-2.el6.remi will be obsoleting
---> Package php-cli.i686 0:5.3.3-3.el6_2.6 will be updated
---> Package php-cli.i686 0:5.3.10-2.el6.remi will be an update
---> Package php-gd.i686 0:5.3.3-3.el6_2.6 will be updated
---> Package php-gd.i686 0:5.3.10-2.el6.remi will be an update
--> Processing Dependency: libt1.so.5 for package: php-gd-5.3.10-2.el6.remi.i686
---> Package php-ldap.i686 0:5.3.3-3.el6_2.6 will be updated
---> Package php-ldap.i686 0:5.3.10-2.el6.remi will be an update
---> Package php-mbstring.i686 0:5.3.3-3.el6_2.6 will be updated
---> Package php-mbstring.i686 0:5.3.10-2.el6.remi will be an update
---> Package php-xml.i686 0:5.3.3-3.el6_2.6 will be updated
---> Package php-xml.i686 0:5.3.10-2.el6.remi will be an update
---> Package php-zts.i686 0:5.3.3-3.el6_2.6 will be obsoleted
--> Running transaction check
---> Package t1lib.i686 0:5.1.2-6.el6_2.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================================================
 Package                                    Arch                             Version                                        Repository                               Size
==========================================================================================================================================================================
Installing:
 mysql-server                               i686                             5.5.23-1.el6.remi                              remi                                     10 M
 php                                        i686                             5.3.10-2.el6.remi                              remi                                    2.3 M
     replacing  php-zts.i686 5.3.3-3.el6_2.6
Updating:
 mysql                                      i686                             5.5.23-1.el6.remi                              remi                                    5.8 M
Installing for dependencies:
 compat-mysql51                             i686                             5.1.54-1.el6.remi                              remi                                    1.4 M
 libaio                                     i686                             0.3.107-10.el6                                 sl                                       20 k
 perl-DBD-MySQL                             i686                             4.013-3.el6                                    sl                                      133 k
 perl-DBI                                   i686                             1.609-4.el6                                    sl                                      704 k
 t1lib                                      i686                             5.1.2-6.el6_2.1                                sl-security                             152 k
Updating for dependencies:
 mysql-libs                                 i686                             5.5.23-1.el6.remi                              remi                                    770 k
 php-cli                                    i686                             5.3.10-2.el6.remi                              remi                                    2.2 M
 php-common                                 i686                             5.3.10-2.el6.remi                              remi                                    854 k
 php-gd                                     i686                             5.3.10-2.el6.remi                              remi                                    130 k
 php-ldap                                   i686                             5.3.10-2.el6.remi                              remi                                     45 k
 php-mbstring                               i686                             5.3.10-2.el6.remi                              remi                                    892 k
 php-mysql                                  i686                             5.3.10-2.el6.remi                              remi                                    117 k
 php-pdo                                    i686                             5.3.10-2.el6.remi                              remi                                    103 k
 php-xml                                    i686                             5.3.10-2.el6.remi                              remi                                    153 k

Transaction Summary
==========================================================================================================================================================================
Install       7 Package(s)
Upgrade      10 Package(s)

Total download size: 26 M
Is this ok [y/N]: y
Downloading Packages:
(1/17): compat-mysql51-5.1.54-1.el6.remi.i686.rpm                                                                                                  | 1.4 MB     02:40     
(2/17): libaio-0.3.107-10.el6.i686.rpm                                                                                                             |  20 kB     00:01     
(3/17): mysql-5.5.23-1.el6.remi.i686.rpm                                                                                                           | 5.8 MB     14:59     
(4/17): mysql-libs-5.5.23-1.el6.remi.i686.rpm                                                                                                      | 770 kB     02:16     
(5/17): mysql-server-5.5.23-1.el6.remi.i686.rpm                                                                                                    |  10 MB     24:53     
(6/17): perl-DBD-MySQL-4.013-3.el6.i686.rpm                                                                                                        | 133 kB     00:29     
(7/17): perl-DBI-1.609-4.el6.i686.rpm                                                                                                              | 704 kB     01:34     
(8/17): php-5.3.10-2.el6.remi.i686.rpm                                                                                                             | 2.3 MB     06:18     
(9/17): php-cli-5.3.10-2.el6.remi.i686.rpm                                                                                                         | 2.2 MB     05:22     
(10/17): php-common-5.3.10-2.el6.remi.i686.rpm                                                                                                     | 854 kB     02:16     
(11/17): php-gd-5.3.10-2.el6.remi.i686.rpm                                                                                                         | 130 kB     00:11     
(12/17): php-ldap-5.3.10-2.el6.remi.i686.rpm                                                                                                       |  45 kB     00:01     
(13/17): php-mbstring-5.3.10-2.el6.remi.i686.rpm                                                                                                   | 892 kB     03:12     
(14/17): php-mysql-5.3.10-2.el6.remi.i686.rpm                                                                                                      | 117 kB     00:12     
(15/17): php-pdo-5.3.10-2.el6.remi.i686.rpm                                                                                                        | 103 kB     00:34     
(16/17): php-xml-5.3.10-2.el6.remi.i686.rpm                                                                                                        | 153 kB     00:27     
(17/17): t1lib-5.1.2-6.el6_2.1.i686.rpm                                                                                                            | 152 kB     00:33     
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                     6.7 kB/s |  26 MB     66:36     
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Importing GPG key 0x00F97F56:
 Userid : Remi Collet <RPMS@FamilleCollet.com>
 Package: remi-release-6-1.el6.remi.noarch (installed)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Updating   : php-common-5.3.10-2.el6.remi.i686                                                                                                                     1/29 

WARNING : These 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   : mysql-libs-5.5.23-1.el6.remi.i686                                                                                                                     2/29 

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 : perl-DBI-1.609-4.el6.i686                                                                                                                             3/29 
  Updating   : php-pdo-5.3.10-2.el6.remi.i686                                                                                                                        4/29 
  Updating   : php-cli-5.3.10-2.el6.remi.i686                                                                                                                        5/29 
  Updating   : mysql-5.5.23-1.el6.remi.i686                                                                                                                          6/29 
  Installing : libaio-0.3.107-10.el6.i686                                                                                                                            7/29 
  Installing : compat-mysql51-5.1.54-1.el6.remi.i686                                                                                                                 8/29 
  Installing : perl-DBD-MySQL-4.013-3.el6.i686                                                                                                                       9/29 
  Installing : t1lib-5.1.2-6.el6_2.1.i686                                                                                                                           10/29 
  Updating   : php-gd-5.3.10-2.el6.remi.i686                                                                                                                        11/29 
  Installing : php-5.3.10-2.el6.remi.i686                                                                                                                           12/29 
  Updating   : php-mysql-5.3.10-2.el6.remi.i686                                                                                                                     13/29 
  Updating   : php-xml-5.3.10-2.el6.remi.i686                                                                                                                       14/29 
  Updating   : php-mbstring-5.3.10-2.el6.remi.i686                                                                                                                  15/29 
  Updating   : php-ldap-5.3.10-2.el6.remi.i686                                                                                                                      16/29 
  Installing : mysql-server-5.5.23-1.el6.remi.i686                                                                                                                  17/29 
  Cleanup    : php-mysql-5.3.3-3.el6_2.6.i686                                                                                                                       18/29 
  Cleanup    : php-5.3.3-3.el6_2.6.i686                                                                                                                             19/29 
  Cleanup    : php-cli-5.3.3-3.el6_2.6.i686                                                                                                                         20/29 
  Cleanup    : php-pdo-5.3.3-3.el6_2.6.i686                                                                                                                         21/29 
  Cleanup    : mysql-5.1.61-1.el6_2.1.i686                                                                                                                          22/29 
  Cleanup    : php-ldap-5.3.3-3.el6_2.6.i686                                                                                                                        23/29 
  Cleanup    : php-mbstring-5.3.3-3.el6_2.6.i686                                                                                                                    24/29 
  Cleanup    : php-xml-5.3.3-3.el6_2.6.i686                                                                                                                         25/29 
  Erasing    : php-zts-5.3.3-3.el6_2.6.i686                                                                                                                         26/29 
  Cleanup    : php-gd-5.3.3-3.el6_2.6.i686                                                                                                                          27/29 
  Cleanup    : php-common-5.3.3-3.el6_2.6.i686                                                                                                                      28/29 
  Cleanup    : mysql-libs-5.1.61-1.el6_2.1.i686                                                                                                                     29/29 

Installed:
  mysql-server.i686 0:5.5.23-1.el6.remi                                                    php.i686 0:5.3.10-2.el6.remi                                                   

Dependency Installed:
  compat-mysql51.i686 0:5.1.54-1.el6.remi  libaio.i686 0:0.3.107-10.el6  perl-DBD-MySQL.i686 0:4.013-3.el6  perl-DBI.i686 0:1.609-4.el6  t1lib.i686 0:5.1.2-6.el6_2.1 

Updated:
  mysql.i686 0:5.5.23-1.el6.remi                                                                                                                                          

Dependency Updated:
  mysql-libs.i686 0:5.5.23-1.el6.remi       php-cli.i686 0:5.3.10-2.el6.remi            php-common.i686 0:5.3.10-2.el6.remi       php-gd.i686 0:5.3.10-2.el6.remi       
  php-ldap.i686 0:5.3.10-2.el6.remi         php-mbstring.i686 0:5.3.10-2.el6.remi       php-mysql.i686 0:5.3.10-2.el6.remi        php-pdo.i686 0:5.3.10-2.el6.remi      
  php-xml.i686 0:5.3.10-2.el6.remi         

Replaced:
  php-zts.i686 0:5.3.3-3.el6_2.6                                                                                                                                          

Complete!
[root@localhost ~]# 

mysql_install_dbの実行

/var/lib/mysqlで作成(ディレクトリが無い場合は755、mysql:mysqlで作成)。mysqlユーザが存在しない場合はあわせて作成。

[root@localhost lib]# su - mysql
-bash-4.1$ mysql_install_db --datadir=/var/lib/mysql
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 localhost.localdomain 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!

-bash-4.1$ exit
logout

mysqlの起動

chkconfigで起動設定とかも好みで。

[root@localhost lib]# service mysqld start
mysqld を起動中:                                           [  OK  ]
[root@localhost lib]# 
[root@localhost lib]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.23 MySQL Community Server (GPL) by Remi

Copyright (c) 2000, 2011, 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>