Percona XtraDB Storage Engine安装笔记

XtraDB 是Percona公司开发的一个MySQL 的存储引擎,其设计的主要目的是用以替代现在的InnoDB。XtraDB 100%的兼容 InnoDB。在性能上有很大提高, 评测可看这里http://www.mysqlperformanceblog.com/2009/07/14/performance-improvements-in-percona-5-0-83-and-xtradb/
以下是我安装过程笔记:

1、下载XtraDB
wget -c http://www.percona.com/mysql/xtradb/5.1.37-7/source/MySQL-percona-5.1.37-7.rhel5.src.rpm


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得到http://bbs2.chinaunix.net/viewthread.php?tid=1568360
需要在安装目录执行
autoconf
automake
libtoolize --force


7.1、autoconf
报以下错误
configure.in:13: error: Autoconf version 2.60 or higher is required
原来需要升级autoconf
wget -c http://ftp.gnu.org/gnu/autoconf/autoconf-2.64.tar.gz
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 http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
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>
连接成功!

 

转载于:https://www.cnblogs.com/seawwh/archive/2011/10/28/2227788.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值