首先下載安裝包:mysql
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包:linux
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*
移除衝突包sql
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.cnfsocket
[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
而後啓動:code
/etc/init.d/mysql start