CentOS7.4 x64環境Percona-Server-5.6安裝

CentOS7.4 x64環境Percona-Server-5.6安裝mysql

下載MySQL

$ cd /usr/local/src/sql

$ 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.rpmui

安裝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.net

備份my.cnf
$ cp /etc/my.cnf /etc/my.cnf.bakserver

調整my.cnf參數(64G內存)blog

$ 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 = 32Mget

啓動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

相關文章
相關標籤/搜索