mysql 5.5升级到 mariadb 10.x
Posted 19 months ago mariadb cli linux bash docker
上文书说到,mariadb 新增了很多诱人特性
今天试着5.5做主,mariadb做从。
好逐步升级至 mariadb10x
master
server_id=13306
gtid_mode=on
enforce_gtid_consistency=on
biglog_format=row
log-bin=xxx
一边导出
mysqldump --master-data=2 --single-transaction --all-databases -uroot -ppassword -h 10.0.0.32 --port 3306 > all.sql
一边导入
mysql -u root -p
#解决mariadb的差异问题
DROP TABLE IF EXISTS mysql.global_priv
DROP VIEW IF EXISTS mysql.user;
source all.sql
mariadb 新增配置文件
slave_skip_errors = 1062,1032,1146,1539,1022
relay-log =/var/lib/mysql/binlog/relay-bin
relay-log-index=/var/lib/mysql/binlog/slave-relay.index
slave_sql_verify_checksum=0
mysql5.5查看进度
show master status\G;
mariadb开启同步
change master to master_host='10.0.0.32',master_user='root',master_password='fxxx',master_log_file='binlog.000004',master_log_pos=107;
start slave;
有问题的话 需要重启进度
stop slave;
reset slave;
查看进度
show slave status\G;
偶现问题
GRANT SELECT, RELOAD, REPLICATION CLIENT, REPLICATION SLAVE , EVENT ON *.* TO 'repl'@'%' IDENTIFIED BY "PASSWORD";
flush privileges;
mysqldump -h 127.0.0.1 -P3306 -u repl --password='PASSWORD' -R -E -e --skip-lock-tables --max_allowed_packet=25165824 --net_buffer_length=16384 --master-data=2 --single-transaction -A --all-databases