CentOS7.4 x64环境Percona-Server-5.6安装

CentOS7.4 x64环境Percona-Server-5.6安装

下载MySQL

$ cd /usr/local/src/

$ wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.38-83.0/binary/redhat/7/x86_64/Percona-Server-shared-56-5.6.38-rel83.0.el7.x86_64.rpm

$ wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.38-83.0/binary/redhat/7/x86_64/Percona-Server-client-56-5.6.38-rel83.0.el7.x86_64.rpm

$ wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.38-83.0/binary/redhat/7/x86_64/Percona-Server-server-56-5.6.38-rel83.0.el7.x86_64.rpm

安装MySQL

$ yum -y localinstall Percona-Server-shared-56-5.6.38-rel83.0.el7.x86_64.rpm
$ yum -y localinstall Percona-Server-client-56-5.6.38-rel83.0.el7.x86_64.rpm
$ yum -y localinstall Percona-Server-server-56-5.6.38-rel83.0.el7.x86_64.rpm

备份my.cnf
$ cp /etc/my.cnf /etc/my.cnf.bak

调整my.cnf参数(64G内存)

$ vi /etc/my.cnf

innodb_buffer_pool_size = 40960M
max_connections=10000
table_open_cache=8192
max_allowed_packet=20M
key_buffer_size = 1024M
sort_buffer_size = 32M
read_buffer_size = 32M
join_buffer_size = 32M

启动MySQL服务

$ service mysqld start

登录mysql设置密码

$ mysql

mysql> set password for 'root'@'localhost'=password('123456');
mysql> set password for 'root'@'127.0.0.1'=password('123456');
mysql> delete from mysql.user where password='';
mysql> GRANT SELECT ON . TO 'readonly'@'192.168' IDENTIFIED BY 'readonly' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> quit

主从配置

参考文章:
CentOS7,MySQL主从配置和读写分离(MySQL主从、MySQL读写分离、MySQL分布式、数据库读写分离、主从配置)
http://blog.csdn.net/envon123/article/details/76615059

posted @ 2018-02-21 17:06  一片相思林  阅读(300)  评论(0编辑  收藏  举报