主備搭建時,備庫上執行如下語句報錯:mysql
(root@localhost:mysql.sock)[(none)]>change master to master_host='192.168.0.57',
-> master_user='rep1',
-> master_password='wqq',
-> master_log_file='binlog.000001',
-> master_log_pos=0;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 2
Current database: *** NONE ***
ERROR 29 (HY000): File '/data/mysql/relay_log/relay.index' not found (Errcode: 2 - No such file or directory)sql
解決辦法:code
建立相應目錄及relay-log.indexserver
[root@upright etc]# cd /data/mysql/io
[root@upright mysql]# mkdir relay_log ast
[root@upright mysql]# cd relay_log/file
[root@upright relay_log]# vi relay-log.indexqq
[root@upright relay_log]# cd ..word
[root@upright mysql]# chown mysql:mysql relay_log -R tab
(root@localhost:mysql.sock)[(none)]>change master to master_host='192.168.0.57', -> master_user='rep1', -> master_password='wqq', -> master_log_file='binlog.000001', -> master_log_pos=0; ERROR 2006 (HY000): MySQL server has gone awayNo connection. Trying to reconnect...Connection id: 2Current database: *** NONE ***Query OK, 0 rows affected, 2 warnings (0.05 sec)