发布于 2014-12-27 09:21:42 | 636 次阅读 | 评论: 0 | 来源: PHPERZ
Percona Server Mysql分支数据库
Percona Server是MySQL的改进版本,使用 XtraDB 存储引擎,在功能和性能上较 MySQL 有着很显著的提升,如提升了在高负载情况下的 InnoDB 的性能,为 DBA 提供了一些非常有用的性能诊断工具,另外有更多的参数和命令来控制服务器行为。
本文为大家讲解的是如何在CentOS下以rpm的方式安装配置percona-server 5.5,感兴趣的同学参考下。
Percona Server是MySQL的改进版本,使用 XtraDB 存储引擎,在功能和性能上较 MySQL 有着很显著的提升,如提升了在高负载情况下的 InnoDB 的性能,为 DBA 提供了一些非常有用的性能诊断工具,另外有更多的参数和命令来控制服务器行为。
wget http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.35-rel33.0/RPM/rhel6/x86_64/Percona-Server-client-55-5.5.35-rel33.0.611.rhel6.x86_64.rpm
&& wget http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.35-rel33.0/RPM/rhel6/x86_64/Percona-Server-devel-55-5.5.35-rel33.0.611.rhel6.x86_64.rpm
&& wget http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.35-rel33.0/RPM/rhel6/x86_64/Percona-Server-server-55-5.5.35-rel33.0.611.rhel6.x86_64.rpm
&& wget http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.35-rel33.0/RPM/rhel6/x86_64/Percona-Server-shared-55-5.5.35-rel33.0.611.rhel6.x86_64.rpm
&& wget http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.35-rel33.0/RPM/rhel6/x86_64/Percona-Server-shared-compat-5.5.35-rel33.0.611.rhel6.x86_64.rpm
rpm -ivh MySQL-server-5.5.34-1.linux2.6.x86_64.rpm
rpm -ivh MySQL-client-5.5.34-1.linux2.6.x86_64.rpm
rpm -ivh MySQL-devel-5.5.34-1.linux2.6.x86_64.rpm
rpm -ivh MySQL-shared-5.5.34-1.linux2.6.x86_64.rpm
rpm -ivh MySQL-shared-compat-5.5.34-1.linux2.6.x86_64.rpm
期间可能会报asio的错,这时需运行
yum -y install libaio*
安装。
如报 conflicts with file from package mysql-libs类似冲突,可以执行yum -y remove mysql-libs*
移除冲突包
groupadd mysql && useradd -g mysql mysql
mkdir /data/mysql -p && chown -R mysql.mysql /data/mysql/
mysql_install_db --datadir=/data/mysql && chown -R mysql.mysql /data/mysql/
编辑/etc/my.cnf
[mysql]
prompt=[\\h][\\u]@\\d\\r:\\m:\\s>
no-auto-rehash
[client]
port=3306
socket=/data/mysql/mysql.sock
[mysqld]
user=mysql
port=3306
slow_query_log_file=mysql.slow
log-bin=mysql-bin
binlog-format=STATEMENT
skip-name-resolve
log-error=mysql.err
default-storage-engine=INNODB
character-set-server=utf8
long_query_time=1
slow_query_log=1
innodb_data_file_path=ibdata1:100M:autoextend
innodb_log_file_size=1G
innodb_file_per_table=1
datadir=/data/mysql/
innodb_data_home_dir=/data/mysql/
innodb_log_group_home_dir=/data/mysql/
pid-file=/data/mysql/mysql.pid
socket=/data/mysql/mysql.sock
innodb_buffer_pool_size=512M
/etc/init.d/mysql start
完成。