当前位置:首页 > 开发教程 > mysql教程 >

MYSQL [记事本](2)

时间:2013-04-24 22:41 来源:网络整理 作者:采集侠 收藏

* 1. row *Slave_IO_State: Waiting for master to send eventMaster_Host: 192.168.1.1Master_User: user_repMaster_Port: 3306Connect_Retry: 60Master_Log_File: binlog.000001Read_Master_Log_Pos: 98Relay_Log

* 1. row * Slave_IO_State: Waiting for master to send event Master_Host: 192.168.1.1 Master_User: user_rep Master_Port: 3306 Connect_Retry: 60 Master_Log_File: binlog.000001 Read_Master_Log_Pos: 98 Relay_Log_File: relay.000003 Relay_Log_Pos: 232 Relay_Master_Log_File: binlog.000001 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 98 Relay_Log_Space: 232 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0

Slave_IO_Running 和Slave_SQL_Running 两列的值都为 “Yes”,表明 Slave 的 I/O 和 SQL 线程都在正常运行.

到此主从库搭建成功.

从库SLAVE启动问题

由于一些错误操作导致CHANGE MASTER和SLAVE服务无法启动,系统报错如下:

Could not initialize master info structure; more error messages can be found in the MySQL error log.

无法初始化master info结构;MySQL错误日志记录了更详细的错误信息.

解决方法:

1.查看MySQL错误日志,查看原因.

如:同步的上一个Position是多少.

很多情况下无法启动服务是由于mysql识别的同步始终停留在上一个Position上.

2.查看master.info和relay-log.info

master.info 记录MASTER相关信息

14 mysql-bin.000030 391156558 192.168.1.1 user_rep rep123 3306 60 0

relay-log.info 记录当前同步日志信息

235 mysql-bin.000030 391156558

3.停止myslq服务,删除master.info和relay-log.info

# service mysql stop

/data/datafile/ # rm master.info

/data/datafile/ # rm relay-log.info

4.启动mysql服务

# service mysql start

5.重新CHANGE MASTER,重新启动SLAVE服务.

问题应该就可以解决了

/var/lib/openshift/bccd8eac1968476490eaee9ced33c7bf/app-root/runtime/repo/php/data/pages/mysql.txt · 最后更改: 2012/09/07 09:21 (外部编辑)


上一篇:MySQL安装指南
下一篇:MySQL 中文网

mysql教程阅读排行

最新文章