移动 mysql 从属

移动 mysql 从属

我正在尝试将 MySQL 从机从旧 PC 移到新 PC。原始从机是 MySQL 版本 5.6.12,与新从机相同(MySQL 是 wamp 2.4 的一部分)。复制在旧机器上工作正常。但是当我停止从机、将数据文件夹和 my.ini 复制到新机器并尝试启动 wamp 时,我得到:

`2015-12-20 17:07:40 144 [Note] Plugin 'FEDERATED' is disabled.
 2015-12-20 17:07:40 144 [Note] InnoDB: The InnoDB memory heap is disabled
 2015-12-20 17:07:40 144 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
 2015-12-20 17:07:40 144 [Note] InnoDB: Compressed tables use zlib 1.2.3
 2015-12-20 17:07:40 144 [Note] InnoDB: Not using CPU crc32 instructions
 2015-12-20 17:07:40 144 [Note] InnoDB: Initializing buffer pool, size = 1.0G
 2015-12-20 17:07:40 144 [Note] InnoDB: Completed initialization of buffer pool
 2015-12-20 17:07:40 144 [Note] InnoDB: Highest supported file format is Barracuda.
 2015-12-20 17:07:40 144 [Note] InnoDB: The log sequence numbers 3737360739086 and 3737360739086 in ibdata files do not match the log sequence number 3737360743076 in the ib_logfiles!
 2015-12-20 17:07:40 144 [Note] InnoDB: Database was not shutdown normally!
 2015-12-20 17:07:40 144 [Note] InnoDB: Starting crash recovery.
 2015-12-20 17:07:40 144 [Note] InnoDB: Reading tablespace information from the .ibd files...
 2015-12-20 17:07:49 144 [Note] InnoDB: Restoring possible half-written data pages 
 2015-12-20 17:07:49 144 [Note] InnoDB: from the doublewrite buffer...
 InnoDB: Last MySQL binlog file position 0 191213785, file name .\mysql-bin.000337
 2015-12-20 17:07:52 144 [Note] InnoDB: 128 rollback segment(s) are active.
 2015-12-20 17:07:53 144 [Note] InnoDB: Waiting for purge to start
 2015-12-20 17:07:53 144 [Note] InnoDB: 5.6.12 started; log sequence number 3737360743076
 2015-12-20 17:07:53 144 [ERROR] Aborting

 2015-12-20 17:07:53 144 [Note] Binlog end
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'partition'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_FT_DELETED'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_METRICS'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_CMPMEM'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_CMP_RESET'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_CMP'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_LOCKS'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'INNODB_TRX'
 2015-12-20 17:07:53 144 [Note] Shutting down plugin 'InnoDB'
 2015-12-20 17:07:53 144 [Note] InnoDB: FTS optimize thread exiting.
 2015-12-20 17:07:53 144 [Note] InnoDB: Starting shutdown...
 2015-12-20 17:07:54 144 [Note] InnoDB: Shutdown completed; log sequence number 3737360748271
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'BLACKHOLE'
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'ARCHIVE'
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'MRG_MYISAM'
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'MyISAM'
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'MEMORY'
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'CSV'
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'sha256_password'
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'mysql_old_password'
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'mysql_native_password'
 2015-12-20 17:07:54 144 [Note] Shutting down plugin 'binlog'
 2015-12-20 17:07:54 144 [Note] 

就这些了。运行 mysqld-debug:

2015-12-20 17:26:01 2896 [Note] Plugin 'FEDERATED' is disabled.
2015-12-20 17:26:01 2896 [Note] InnoDB: The InnoDB memory heap is disabled
2015-12-20 17:26:01 2896 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-12-20 17:26:01 2896 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-12-20 17:26:01 2896 [Note] InnoDB: Not using CPU crc32 instructions
2015-12-20 17:26:01 2896 [Note] InnoDB: Initializing buffer pool, size = 1.0G
2015-12-20 17:26:01 2896 [Note] InnoDB: Completed initialization of buffer pool
2015-12-20 17:26:01 2896 [Note] InnoDB: Highest supported file format is Barracuda.
2015-12-20 17:26:06 2896 [Note] InnoDB: 128 rollback segment(s) are active.
2015-12-20 17:26:06 2896 [Note] InnoDB: Waiting for purge to start
2015-12-20 17:26:06 2896 [Note] InnoDB: 5.6.12 started; log sequence number 3737360748271
2015-12-20 17:26:06 2896 [Note] Server hostname (bind-address): '*'; port: 3307
2015-12-20 17:26:06 2896 [Note] IPv6 is available.
2015-12-20 17:26:06 2896 [Note]   - '::' resolves to '::';
2015-12-20 17:26:06 2896 [Note] Server socket created on IP: '::'.

然后我连接到数据库,运行查询“SHOW SLAVE STATUS”:

Slave_IO_STATE:Connecting to master 
LAST_IO_ERRNO:2003
Last_IO_ERROR:error connecting to master '[email protected]:3306' - retry-time: 60  retries: 5

防火墙已关闭,主 IP 可用(ping 有效)。我想知道,出了什么问题 - 常规 wamp 启动服务失败且没有错误号,mysqld-debug 无法连接到主服务器。

当从属设备在原始虚拟机上运行时没有任何问题,可能出了什么问题? 感谢大家的回答。

答案1

您是否已更新授权以允许新的从属设备连接?

答案2

尽管日志中没有提到,但 MySQL 遗漏了 errmsg.sys 文件。Windows 事件查看器中提到了这一点。复制 errmsg.sys 后,一切正常,从属服务器正常运行。

相关内容