下载 percona-server-5.6.26-74.0.tar.gz

利用yum安装一些必须的软件:

yum -y install make gcc gcc-c++ cmake bison-devel  ncurses-devel gcc \

autoconf* automake* zlib* fiex* libxml* libmcrypt* libtool-ltdl-devel* \
openssl openssl-devel ncurses compat* mpfr cpp glibc  readline-devel
解压缩percona server,然后输入:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \

-DSYSCONFDIR=/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DMYSQL_UNIX_ADDR=/var/run/mysql.sock \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci  -DMYSQL_USER=mysql

make

make install

当make成功后就在/usr/local/mysql建立mysql服务

cd /usr/local/mysql/

cp support-files/mysql.server /etc/init.d/mysql

mkdir -p /Data/mysql/data

chown -R mysql. /Data

ln -s /usr/local/mysql/lib /usr/lib/mysql

ln -s/usr/local/mysql/include/mysql /usr/include/mysqlln -s /usr/local/mysql/lib/libperconaserverclient.so.18 /usr/lib64/libmysqlclient.so.18

创建my.cnf文件:

[mysqld]#sql_mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"pid-file=/Data/mysql/mysqld.piddatadir = /Data/mysql/datasocket=/Data/mysql/mysql.sockuser=mysqlcharacter-set-server = utf8port = 3306# Disabling symbolic-links is recommended to prevent assorted security risks#symbolic-links=0default-storage-engine=InnoDBexplicit_defaults_for_timestamp=truemax_connections = 300#sort_buffer_size = 16M#join_buffer_size = 16M#read_buffer_size = 24M#read_rnd_buffer_size = 24M#bulk_insert_buffer_size=64M#InnoDB##if the below parameter added later, mysql cannot startup.innodb_data_home_dir=/Data/mysql/inndb_datainnodb_data_file_path=ibdata1:2048M:autoextendinnodb_file_per_table=1innodb_file_format=barracudainnodb_buffer_pool_size = 1G  innodb_buffer_pool_instances=3innodb_purge_threads=1innodb_support_xa=FALSEinnodb_flush_method = O_DIRECTinnodb_io_capacity=200skip_innodb_adaptive_hash_indexinnodb_read_io_threads=8innodb_write_io_threads=8innodb_change_buffering=allinnodb_stats_on_metadata=offinnodb_log_group_home_dir=/Data/mysql/innodb_loginnodb_log_buffer_size = 16Minnodb_log_file_size = 256M  innodb_log_files_in_group = 3  innodb_flush_log_at_trx_commit=2innodb_autoinc_lock_mode=2innodb_additional_mem_pool_size = 32M  innodb_thread_concurrency=8 skip_grant_tablesmax_tmp_tables=100query_cache_size=0query_cache_type=0max_prepared_stmt_count=1048576sort_buffer_size=32769#BINLOG#binlog-do-db=sumarc#binlog-do-db=middlewarelog-bin=/Data/mysql/binlog/bin-file.logbinlog_cache_size = 1Mbinlog_format=MIXEDmax_binlog_size=256Mmax_binlog_cache_size=50Mexpire_logs_days = 91sync_binlog=2#slow_query_log=on#long_query_time=1#slow_query_log_file=/Data/mysql/slowlog/mysql-slowlog-error=/Data/mysql/mysqld_error.log#slave-skip-errors=1032,1062,126,1114,1146,1048,1396#skip-host-cache#skip-name-resolve#rpl_semi_sync_master_enabled=1#rpl_semi_sync_master_timeout=1000#rpl_semi_sync_master_trace_level=32#rpl_semi_sync_master_wait_no_slave=on[mysqld_safe]pid-file=/Data/mysql/mysqld.pid#socket=/var/run/mysql.sock[client]socket=/Data/mysql/mysql.sock

填充数据:

scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/Data/mysql/data/ --user=mysql

启动mysql:

/etc/init.d/mysql start

启动成功