Percona XtraDB Storage Engine安裝筆記

denniswwh發表於2009-09-11
XtraDB 是Percona公司開發的一個MySQL 的儲存引擎,其設計的主要目的是用以替代現在的InnoDB。XtraDB 100%的相容 InnoDB。在效能上有很大提高,
評測可看這裡http://www.mysqlperformanceblog.com/2009/07/14/performance-improvements-in-percona-5-0-83-and-xtradb/

以下是我安裝過程筆記:[@more@]

1、下載XtraDB
wget -c

2、下載下來是rpm原始碼包,使用rpm解包
rpm -ivh MySQL-percona-5.1.37-7.rhel5.src.rpm

3、解壓原始碼包
cd /usr/src/redhat/SOURCES
tar -zxvf mysql-5.1.37.tar.gz
tar -zxvf percona-xtradb-1.0.3-7.tar.gz

4、覆蓋innobase原始碼
mv mysql-5.1.37/storage/innobase/ ~/
cp -R percona-xtradb-1.0.3-7 mysql-5.1.37/storage/innobase

cd mysql-5.1.37
patch -p1 < ../percona-support.patch

5、建立組和使用者
groupadd mysql
useradd -g mysql mysql

6、編譯安裝
CC="ccache /usr/local/gcc-4.3.2/bin/gcc -static-libgcc"
CFLAGS="-O3 -march=i686 -mpentiumpro -mstack-align-double"
CXX="ccache /usr/local/gcc-4.3.2/bin/gcc -static-libgcc"
CXXFLAGS="-O3 -march=i686 -mpentiumpro -mstack-align-double -felide-constructors -fno-exceptions -fno-rtti"

./configure
--prefix=/usr/local/mysql-xtradb --datadir=/usr/local/mysql-xtradb/data
--with-mysqld-user=mysql
--with-server-suffix=-xtradb
--with-plugins=partition,archive,blackhole,csv,innobase,federated
--with-extra-charsets=complex --with-charset=utf8 --with-collation=utf8_general_ci
--with-big-tables
--with-ssl
--with-fast-mutexes
--with-zlib-dir=bundled
--with-client-ldflags=-static
--with-mysqld-ldflags=-static
--with-pic --enable-assembler --enable-local-infile
--enable-thread-safe-client
--with-comment="MySQL Community Server (GPL)"


make
make install

7、由於我的系統比較舊,configure過程中遇到了錯誤以下是解決過程。
/bin/rm: cannot remove `libtoolT': No such file or directory
google得到
需要在安裝目錄執行
autoconf
automake
libtoolize --force

7.1、autoconf
報以下錯誤
configure.in:13: error: Autoconf version 2.60 or higher is required
原來需要升級autoconf
wget -c
tar -zxvf autoconf-2.64.tar.gz
cd autoconf-2.64
./configure --prefix=/usr
make
make install

升級完成後,再執行autoconf,還需要升級m4
checking for GNU M4 that supports accurate traces... configure: error: no acceptable m4 could be found in $PATH.
GNU M4 1.4.6 or later is required; 1.4.13 is recommended

wget -c
tar -zxvf m4-1.4.9.tar.gz
cd m4-1.4.9
./configure --prefix=/usr
make
make install

7.2、automake
報錯
You should recreate
configure.in:13: aclocal.m4 with aclocal and run automake again.
執行aclocal再automake,還報錯
client/Makefile.am: required file `./compile' not found
缺少compile檔案,copy一個過來
cp BUILD/compile-pentium-icc ./compile
再執行automake成功

7.3、libtoolize --force
此後再進行mysql的編譯安裝順利完成。

8、配置
由於我之前安裝有mysql,直接cp了一個my.cnf改了一下埠目錄等

9、初始化
cd /usr/local/mysql-xtradb/
bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql-xtradb/data

10、目錄許可權
chown -R mysql.mysql /usr/local/mysql-xtradb

11、啟動
bin/mysqld_safe --defaults-file=/usr/local/mysql-xtradb/my.cnf --user=mysql &

12、測試
bin/mysql -S./mysql.sock
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 6
Server version: 5.1.37-xtradb-log MySQL Community Server with XtraDB (GPL)

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

mysql>

連線成功!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/124805/viewspace-1026850/,如需轉載,請註明出處,否則將追究法律責任。

相關文章