LoginSignup
0
1

More than 5 years have passed since last update.

古い MySQL (5.0.77) をビルドしてインストールする

Posted at

ちょっと古い CentOS (5.4) で古い MySQL をインストールする必要があったのでメモ

MySQL インストール

参考: http://myknowledge.seesaa.net/article/99361578.html

cd /usr/local/src
yum -y install gcc gcc-c++ ncurses-devel
wget --no-check-certificate http://downloads.mysql.com/archives/mysql-5.0/mysql-5.0.77.tar.gz

tar -xvf mysql-5.0.77.tar.gz
cd /usr/local/src/mysql-5.0.77
./configure \
    --prefix=/usr/local/mysql \
    --with-mysqld-user=mysql \
    --with-client-ldflags=-all-static \
    --with-mysqld-ldflags=-all-static \
    --with-charset=utf8 \
    --with-collation=utf8_general_ci \
    --with-extra-charsets=all \
    --enable-assembler \
    --enable-local-infile

make
make install

MySQL 初期化設定

groupadd -r mysql
useradd -r -g mysql mysql
/usr/local/mysql/bin/mysql_install_db \
    --basedir=/usr/local/mysql \
    --datadir=/var/lib/mysql \
    --user=mysql
chown -R mysql:mysql /usr/local/mysql

cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/
service mysql.server start

/usr/local/mysql/bin/mysql_secure_installation

自動起動設定

chkconfig --add mysql.server
chkconfig mysql.server on
chkconfig --list|grep mysql
mysql.server    0:off   1:off   2:on    3:on    4:on    5:on    6:off
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1