我要做个mysql 双机热备,主服务器配置如下:
server-id=1
log-bin="C:/Program Files/MySQL/MySQL Server 5.1/mysqllog"
binlog-do-db=project_gis配置完成了能正常启动,日志也生成了。从服务器配置如下:
server-id=2
master-host=192.168.0.101
master-user=dbback 
master-passWord=dbback
master-port=3306
master-connect-retry=60 
replicate-do-db=projectdbback用户我都授权了,数据库版本都是5.1.30
但是我的从服务器现在起不来,不知道为什么,删除掉上面的配置就好了。

解决方案 »

  1.   

    090202 11:26:11 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: ready for connections.
    Version: '5.1.30-community-log'  socket: ''  port: 3306  MySQL Community Server (GPL)
    090202 11:26:11 [Note] Slave I/O thread: connected to master '[email protected]:3306',replication started in log 'FIRST' at position 4
    090202 11:26:11 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    090202 11:26:11 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'FIRST' at postion 4
    090202 11:26:11 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    090202 11:27:11 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'FIRST' at postion 4
    090202 11:27:11 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    090202 11:28:11 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'FIRST' at postion 4
    090202 11:28:11 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    090202 11:29:11 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'FIRST' at postion 4
    090202 11:29:11 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    090202 11:29:51 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Normal shutdown090202 11:29:51 [Note] Event Scheduler: Purging the queue. 0 events
    090202 11:30:11 [Note] Slave I/O thread killed while waiting to reconnect after a failed read
    090202 11:30:11 [Note] Slave I/O thread exiting, read up to log 'FIRST', position 4
    090202 11:30:11 [Note] Error reading relay log event: slave SQL thread was killed
    090202 11:30:13 [Warning] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Forcing close of thread 3  user: 'root'090202 11:30:13  InnoDB: Starting shutdown...
    090202 11:30:14  InnoDB: Shutdown completed; log sequence number 0 72649251
    090202 11:30:14 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Shutdown complete090202 11:30:15  InnoDB: Started; log sequence number 0 72649251
    090202 11:30:15 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=123e9f73cb3e409-relay-bin' to avoid this problem.
    090202 11:30:15 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 106, relay log '.\123e9f73cb3e409-relay-bin.000009' position: 4
    090202 11:30:15 [Note] Event Scheduler: Loaded 0 events
    090202 11:30:15 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: ready for connections.
    Version: '5.1.30-community'  socket: ''  port: 3306  MySQL Community Server (GPL)
    090202 11:30:15 [Note] Slave I/O thread: connected to master '[email protected]:3306',replication started in log 'FIRST' at position 4
    090202 11:30:15 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    090202 11:30:15 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'FIRST' at postion 4
    090202 11:30:15 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    090202 11:31:15 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'FIRST' at postion 4
    090202 11:31:15 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    090202 11:32:01 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Normal shutdown090202 11:32:01 [Note] Event Scheduler: Purging the queue. 0 events
    090202 11:32:15 [Note] Slave I/O thread killed while waiting to reconnect after a failed read
    090202 11:32:15 [Note] Slave I/O thread exiting, read up to log 'FIRST', position 4
    090202 11:32:15 [Note] Error reading relay log event: slave SQL thread was killed
    090202 11:32:17 [Warning] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Forcing close of thread 3  user: 'root'090202 11:32:17  InnoDB: Starting shutdown...
    090202 11:32:18  InnoDB: Shutdown completed; log sequence number 0 72649251
    090202 11:32:18 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Shutdown complete090202 11:32:19  InnoDB: Started; log sequence number 0 72649251
    090202 11:32:19 [ERROR] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: unknown option '--CHANGE MASTER TO'
    090202 11:32:19 [ERROR] Aborting090202 11:32:19  InnoDB: Starting shutdown...
    090202 11:32:20  InnoDB: Shutdown completed; log sequence number 0 72649251
    090202 11:32:20 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Shutdown complete090202 11:32:53  InnoDB: Started; log sequence number 0 72649251
    090202 11:32:53 [ERROR] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: unknown variable 'MASTER_HOST=192.168.0.101'
    090202 11:32:53 [ERROR] Aborting090202 11:32:53  InnoDB: Starting shutdown...
    090202 11:32:55  InnoDB: Shutdown completed; log sequence number 0 72649251
    090202 11:32:55 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Shutdown complete090202 11:55:16  InnoDB: Started; log sequence number 0 72649251
    090202 11:55:16 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=123e9f73cb3e409-relay-bin' to avoid this problem.
    090202 11:55:16 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 106, relay log '.\123e9f73cb3e409-relay-bin.000010' position: 4
    090202 11:55:16 [Note] Event Scheduler: Loaded 0 events
    090202 11:55:16 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: ready for connections.
    Version: '5.1.30-community'  socket: ''  port: 3306  MySQL Community Server (GPL)
    090202 11:55:16 [Note] Slave I/O thread: connected to master '[email protected]:3306',replication started in log 'FIRST' at position 4
    090202 11:55:16 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    090202 11:55:16 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'FIRST' at postion 4
    090202 11:55:16 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
      

  2.   

    不用贴这么多了。。第一条就说了,你从服务器去主服务器取文件的权限不够。090202 11:26:11 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227) 用这个加一下权限。(我这几句用户名,密码,IP什么的,你都要根据自己的情况改一下啊。)grant file on *.* to bak@'192.168.5.4 identified by '123456'; 
    grant all privileges on backup.* to bak@’192.168.5.4’ identified by ‘123456’;
    flush privileges;
      

  3.   

    090203 10:49:55 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'FIRST' at postion 4
    090203 10:49:55 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
    我把权限都给了 为什么提示这个错误啊,好像读不了日志
      

  4.   

    把你备用机上的二进制备份日志文件删除,强制它从主机读试试。要删的文件有形如hostname-relay-bin.XXX(多个),和 hostname-relay-bin.index 和 relay-log.info两个文件。删除完后,再重新启动一下。不过你这个log 'FIRST' 让我有些奇怪,难到你指定了记录同步动作的日志文件名吗?这个选项不如按系统默认。
      

  5.   

    错鸟,刚才没看仔细,你应该还是出的第一个的问题。你把主备双方都改成root用户和密码试一下,这样就不存在权限问题了。记住,是在备的配置文件里,把主的root用户及密码写进去,因为备是用这个用户去取数据的。
      

  6.   

    本帖最后由 yueliangdao0608 于 2009-02-06 12:40:55 编辑
      

  7.   

    I have the same trouble, could someone reply the solution  in english, please?!!