mysql主从复制问题??

joeluo 发布于 2011/07/04 23:15
阅读 2K+
收藏 0

原来主从复制正常,但有次将主server的mysql直接关了,之后从前后就无法连接到主server进行主从复制了,重新连接后从server查看主的状态:

mysql> show slave status\G;

*************************** 1. row ***************************

               Slave_IO_State: Waiting to reconnect after a failed master event read

                  Master_Host: 192.168.1.6

                  Master_User: backup

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000005

          Read_Master_Log_Pos: 107

               Relay_Log_File: ubuntu-relay-bin.000001

                Relay_Log_Pos: 4

        Relay_Master_Log_File: mysql-bin.000005

             Slave_IO_Running: No

            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: 107

              Relay_Log_Space: 106

              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: NULL

Master_SSL_Verify_Server_Cert: No

                Last_IO_Errno: 0

                Last_IO_Error: 

               Last_SQL_Errno: 0

               Last_SQL_Error: 

1 row in set (0.00 sec)

 

slave stop后重新连接主server还是报这个错,从日志错误:

110704 23:02:27 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000005' at postion 107

110704 23:02:27 [ERROR] Error reading packet from server: Access denied; you need (at least one of) the REPLICATION SLAVE privilege(s) for this operation ( server_errno=1227)

110704 23:03:27 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000005' at postion 107

110704 23:03:27 [ERROR] Error reading packet from server: Access denied; you need (at least one of) the REPLICATION SLAVE privilege(s) for this operation ( server_errno=1227)

110704 23:04:27 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000005' at postion 107

110704 23:04:27 [ERROR] Error reading packet from server: Access denied; you need (at least one of) the REPLICATION SLAVE privilege(s) for this operation ( server_errno=1227)


加载中
0
王京伟
王京伟

看日志貌似是数据库的权限问题

0
joeluo
joeluo

引用来自“王京伟”的答案

看日志貌似是数据库的权限问题

创建了replication slave用户,可以远程登入
0
王京伟
王京伟

引用来自“joeluo”的答案

引用来自“王京伟”的答案

看日志貌似是数据库的权限问题

创建了replication slave用户,可以远程登入
登入不一定有复制的权限哦  看你的提示是没有slave replacation的权限
0
wgzh159
wgzh159
slave_io_running这个进程没有启动,好像不能从主数据库接收日志,具体原因我也不清楚,来看答案的...
0
Lucixfer
Lucixfer
不知道楼主有没有解决 我也遇到了这个问题~~
返回顶部
顶部