mysql8.0安装配置以及主从复制
原创    xiaofei    发表于:2019-11-17 10:47:22
  阅读 :99   收藏   编辑

window 安装mysql8.0 准备安装包mysql-installer-community-8.0.18.0.msi、ndp48-web.exe、vc_redist.x64.exe

mysql 打开正常安装
安装完后配置
1、配置navicat密码
ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘123456’;
2、配置my.ini
innodb_buffer_pool_size=4G
注意保存文件格式ansi
3、设置group_concat长度
group_concat_max_len = 102400
配置主从复制
主:
1、配置my.ini
server-id=1 log-bin=mysql-bin binlog-do-db=test binlog-ignore-db=mysql
2、设置slave账号
CREATE USER 'slave'@'192.168.xxx.xxx' IDENTIFIED BY '123456'; ALTER USER 'slave'@'192.168.xxx.xxx' IDENTIFIED WITH 'mysql_native_password' BY '123456'
3、守则slave权限
GRANT REPLICATION SLAVE ON . TO ‘slave’@’192.168.xxx.xxx’;
从:
1、配置my.ini
server-id=2 log-bin=mysql-bin binlog-do-db=test binlog-ignore-db=mysql
2、停止slave
stop slave

开始配置主从复制
1、主操作
show master status;
查看文件名称,位置positon
2、从操作
change master to master_host='192.168.xxx.xxx',master_port=3306,master_user='slave',master_password='123456',master_log_file='mysqlbin.000001',master_log_pos=xx
3、从服务器
start slave; show slave status\G

评论
条评论

推荐阅读