mysql-5.1.45のコンパイル&インストール
方針
- mysqlユーザで動作させる
useradd mysql
- innodbを使えるようにする
- 文字コードは一応全部入れておく
コンパイル・インストールはすべてmysqlユーザになって実行する
su mysql
コンパイルオプション
CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \
-felide-constructors -fno-exceptions -fno-rtti" ./configure \
--prefix=/home/mysql \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--enable-shared \
--enable-static \
--enable-assembler \
--with-charset=utf8 \
--with-extra-charsets=complex \
--with-collation=utf8_bin \
--with-plugins=partition,csv,innobase,innodb_plugin,myisam,blackhole \
--with-mysqld-user=mysql
コンパイル&インストール
make
make install
cd /home/mysql/bin/
./mysql_install_db
起動スクリプトのinit.dへのコピー
cd /home/mysql/share/mysql/
sudo cp mysql.server /etc/init.d/mysqld
my.cnfのコピー
cd /home/mysql/share/mysql
sudo cp my-medium.cnf /etc/my.cnf