1.问题一:
如果从库的Slave_IO_Running为NO。
The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
解决方法:
show variables like 'server_id';
set global server_id=2;
slave start;
!!!修改完后必须重启进程
2.问题二:
查看mysql主从配置的状态及修正 slave不启动问题
解决方法:
查看master的状态:
show master status; //Position不应该为0
show processlist;
//state状态应该为Has sent all binlog to slave; waiting for binlog to be updated
查看slave状态:
show slave status;
//Slave_IO_Running 与 Slave_SQL_Running 状态都要为Yes
show processlist;
//应该有两行state值为:
Has read all relay log; waiting for the slave I/O thread to update it
Waiting for master to send event
3.问题三:
如果从库的slave_sql_running为NO。
解决方法:
slave stop;
set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
slave start;
!!!修改完后必须重启进程
4.问题四:
主从同步后,从修改后主从断开连接
主库锁定表:
flush tables with read lock;
show master status;
5.问题四:
主改从必改,从改主不改
6.问题五:
建立多个MySQL服务
设置basedir="F:/MySql2/"
设置datadir="F:/MySql2/Data/"
f:
cd MySql2
cd bin
mysqld-nt --install mysql_cy --defaults-file=f:\mysql_1\my.ini
移除建立的MySql服务
f:
cd MySql2
cd bin
mysqld-nt --remove mysql_cy