linux安装mysql8并配置主从
服务器
10.213.3.68 DBmaser
10.213.3.69 DBslave
都安装mysql8安装包,解压
mysql-8.0.35-linux-glibc2.17-x86_64.tar.xz
[root@DB-master mysql8]# ls
bin docs include lib LICENSE man README share support-files
优化过的配置文件
[mysqld]
server-id=1
log-bin=mysql-bin
port = 3306
user = mysql
basedir=/data/mysql8
datadir=/data/mysql8data
socket=/tmp/mysql.sock
log-error=/data/mysql8/error.log
pid-file=/data/mysql8/mysql.pid
lower_case_table_names=1
autocommit =1
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
###query config###
join_buffer_size = 128M
sort_buffer_size = 16M
read_buffer_size = 16M
read_rnd_buffer_size = 8M
###open table config###
table_open_cache=2000
table_open_cache_instances=16
###connection config###
max_connections=2000
thread_cache_size=200
###binlog config###
binlog_format=ROW
max_binlog_size=1G
binlog_cache_size=16M
binlog_expire_logs_seconds=604800
enforce_gtid_consistency=ON
gtid_mode=ON
###innodb redo log config###
innodb_log_file_size=1G
innodb_log_files_in_group=3
innodb_log_buffer_size=16M
innodb_buffer_pool_size=8G
innodb_open_files=10000
open_files_limit=10000
注意主从的server-id不能
本帖子也是纯手工制作,转载请标明出处-----------burukku(づ。◕ᴗᴗ◕。)づ