Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1012766
  • 博文数量: 116
  • 博客积分: 3758
  • 博客等级: 中校
  • 技术积分: 1316
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-17 11:49
个人简介

这家伙很懒。。。

文章分类

全部博文(116)

文章存档

2016年(3)

2015年(2)

2014年(1)

2013年(9)

2012年(25)

2011年(50)

2010年(12)

2009年(14)

分类: Mysql/postgreSQL

2011-03-18 22:22:11

Description:

mysql> start slave;
ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log


Resolve solution:

[root@slave ~]# service mysqld stop
[root@slave mysql]# rm -rf master.info 
[root@slave mysql]# rm -rf relay-log.info
[root@slave mysql]# rm -rf slave-relay-bin.*   (经测试master.info与relay-log.info里没有内容时可以这样删除)
[root@slave ~]# service mysqld start
[root@master ~]# mysql -uroot -p
mysql> show master status;
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000011 |       98 |              |                  | 
+------------------+----------+--------------+------------------+
[root@slave ~]# mysql -uroot -p

mysql> change master to 
master_log_file='mysql-bin.000011',
master_log_pos=98,
master_host='192.168.3.21',
master_port=3307,
master_user='slave',
master_password='12345678';
Query OK, 0 rows affected (0.02 sec)
mysql> start slave;
Query OK, 0 rows affected (0.00 sec)
mysql> show slave status\G
*************************** 1. row ***************************
             Slave_IO_State: Waiting for master to send event
                Master_Host: 192.168.3.21
                Master_User: slave
                Master_Port: 3307
              Connect_Retry: 60
            Master_Log_File: mysql-bin.000011
        Read_Master_Log_Pos: 98
             Relay_Log_File: mysqld-relay-bin.000002
              Relay_Log_Pos: 235
      Relay_Master_Log_File: mysql-bin.000011
           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: 235
            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
1 row in set (0.00 sec)
阅读(1155) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~