MySQL 5.0.90 インストール

2010年04月09日 20時41分 MySQL • Tags: ,



CentOS5へのMySQL5.0のインストールメモです。

インストール(自分でコンパイル)
MySQL(mysql-5.0.90.tar.gz)を自分でコンパイルしてインストールします。特にこだわりが無ければyumでインストールしても問題はありません(むしろ楽です)。

[~]# groupadd mysql
[~]# useradd -g mysql mysql -s /sbin/nologin
[~]# wget http://downloads.mysql.com/archives/mysql-5.0/mysql-5.0.90.tar.gz
[~]# tar xvzf mysql-5.0.90.tar.gz
[~]# cd mysql-5.0.90
[mysql-5.0.90]# ./configure --prefix=/usr/local/mysql5
checking for termcap functions library... configure: error: No curses/termcap library found
[mysql-5.0.90]# yum install ncurses-devel
[mysql-5.0.90]# make
[mysql-5.0.90]# make install
[mysql-5.0.90]# cp support-files/my-huge.cnf /etc/my.cnf
[mysql-5.0.90]# vi /etc/my.cnf
basedir = /usr/local/mysql5
datadir = /usr/local/mysql5/data
[mysql-5.0.90]# /usr/local/mysql5/bin/mysql_install_db --user=mysql
[mysql-5.0.90]# chown -R mysql:mysql /usr/local/mysql5/
[mysql-5.0.90]# /usr/local/mysql5/bin/mysqld_safe --user=mysql &
[mysql-5.0.90]# ps -ef | grep mysql
root      3024  2925  0 22:45 pts/0    00:00:00 /bin/sh /usr/local/mysql5/bin/mysqld_safe --user=mysql
mysql     3056  3024  1 22:45 pts/0    00:00:00 /usr/local/mysql5/libexec/mysqld --basedir=/usr/local/mysql5 --datadir=/usr/local/mysql5/data --user=mysql --pid-file=/usr/local/mysql5/data/hrtdotnet.org.pid --skip-external-locking --port=3306 --socket=/tmp/mysql.sock
[mysql-5.0.90]# /usr/local/mysql5/bin/mysqladmin -u root password 'XXXXXX'
[mysql-5.0.90]# /usr/local/mysql5/bin/mysql -u root -p
mysql> quit
[mysql-5.0.90]# /usr/local/mysql5/bin/mysqladmin -u root -p shutdown

 
インストール(yumを利用)
yumを利用してMySQL(5.0.77)関連の環境をまとめてインストールします。

[~]# yum install mysql mysql-devel mysql-server
==========================================================================================
 Package                    Arch        Version                     Repository       Size
==========================================================================================
Installing:
 mysql                      i386        5.0.77-4.el5_4.2            updates         4.8 M
 mysql-devel                i386        5.0.77-4.el5_4.2            updates         2.4 M
 mysql-server               i386        5.0.77-4.el5_4.2            updates         9.8 M
Installing for dependencies:
 e2fsprogs-devel            i386        1.39-23.el5                 base            568 k
 keyutils-libs-devel        i386        1.2-1.el5                   base             27 k
 krb5-devel                 i386        1.6.1-36.el5_4.1            updates         1.8 M
 libselinux-devel           i386        1.33.4-5.5.el5              base            143 k
 libsepol-devel             i386        1.15.2-2.el5                base            187 k
 openssl-devel              i386        0.9.8e-12.el5_4.6           updates         1.9 M
 perl-DBD-mysql             i386        4.013-1.el5.rf              rpmforge        224 k
 perl-DBI                   i386        1.52-2.el5                  base            600 k
 zlib-devel                 i386        1.2.3-3                     base            101 k

Transaction Summary
==========================================================================================
Install     12 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 22 M
Is this ok [y/N]: y
[~]# /etc/init.d/mysqld start
MySQL を起動中:                                            [  OK  ]
[~]# /etc/init.d/mysqld stop
MySQL を停止中:                                            [  OK  ]
[~]# /sbin/chkconfig --list | grep mysql
mysqld          0:off   1:off   2:off   3:off   4:off   5:off   6:off


Leave a Reply

preload preload preload