MySQL的奴隶数据库错误连接到主人

时间:2018-09-17 18:47:06

标签: mysql

错误,我在从数据库中进入了 mysqld.log 。这突然停止了工作...

180917 18:01:44 mysqld_safe Starting mysqld daemon with databases from /var/www/ncc-web/var/mysql
180917 18:01:44 InnoDB: The InnoDB memory heap is disabled
180917 18:01:44 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180917 18:01:44 InnoDB: Compressed tables use zlib 1.2.7
180917 18:01:44 InnoDB: Initializing buffer pool, size = 2.0G
180917 18:01:44 InnoDB: Completed initialization of buffer pool
180917 18:01:44 InnoDB: highest supported file format is Barracuda.
180917 18:01:44  InnoDB: Waiting for the background threads to start
180917 18:01:45 InnoDB: 1.1.8 started; log sequence number 106350794935
180917 18:01:45 [Warning] Failed to setup SSL
180917 18:01:45 [Warning] SSL error: Failed to set ciphers to use
180917 18:01:45 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
180917 18:01:45 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
180917 18:01:45 [Note] Server socket created on IP: '0.0.0.0'.
180917 18:01:45 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000214' at position 11716747, relay log '/<path>/var/mysql/mysql-relay-bin.000681' position: 11716893
180917 18:01:45 [ERROR] Slave SQL: Could not execute Update_rows event on table performance_schema.setup_instruments; Can't find record in 'setup_instruments', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log mysql-bin.000214, end_log_pos 11717881, Error_code: 1032
180917 18:01:45 [Warning] Slave: Can't find record in 'setup_instruments' Error_code: 1032
180917 18:01:45 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000214' position 11716747
180917 18:01:45 [Note] Event Scheduler: Loaded 0 events
180917 18:01:45 [Note] /<path>/parts/mysql/bin/mysqld: ready for connections.
Version: '5.5.28-log'  socket: '/<path>/var/mysql/mysql.sock'  port: 3306  Source distribution
180917 18:01:45 [ERROR] Slave I/O: error connecting to master 'replication@xx.xx.xx.xx:3306' - retry-time: 60  retries: 86400, Error_code: 1129

我不确定如何解决。我继承了它,所以我从没有设置它。

解决方案:

除了以下有关克服有关更新行的错误的建议:

SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
Stop slave;
start slave;

我发现从属I / O错误Error_code:1129与最大连接数有关:

我试图从从服务器连接到主服务器:

[$ bin / mysql -h xx.xx.xx.xx -u 错误1129(HY000):由于许多连接错误,主机'xx.xx.xx.xx'被阻止。使用“ mysqladmin flush-hosts”取消阻止

我在主服务器上执行了mysqladmin flush-hosts,一切都修复了!!

1 个答案:

答案 0 :(得分:0)

从站打算删除不存在的记录,因此进入错误状态。

如果是单个错误,您可以跳过二进制日志中的该行以继续运行而无需运行该语句。

只需在mysql客户端(从站)上运行以下命令即可。

mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
mysql> STOP SLAVE;
mysql> START SLAVE;