我要做个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
但是我的从服务器现在起不来,不知道为什么,删除掉上面的配置就好了。
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
但是我的从服务器现在起不来,不知道为什么,删除掉上面的配置就好了。
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)
grant all privileges on backup.* to bak@’192.168.5.4’ identified by ‘123456’;
flush privileges;
090203 10:49:55 [ERROR] Error reading packet from server: Access denied; you need the REPLICATION SLAVE privilege for this operation ( server_errno=1227)
我把权限都给了 为什么提示这个错误啊,好像读不了日志