MYSQL启动错误之[ERROR] Failed to open log (file './mysql-bin.000039', errno 2)

       今天收到报警说MYSQL的slave挂掉了,检查日志,发现是因为之前搭建主从的时候没有将主库的event传过来,而在主库又更新了event的属性,在参数文件中忽略掉这个错误:

    max_connections = 1000
max_connect_errors = 10
table_open_cache = 8096
#external-locking
max_allowed_packet = 16M
binlog_cache_size = 1M
max_heap_table_size = 8M
sort_buffer_size = 256M
join_buffer_size = 8M
thread_cache_size = 8
slave-skip-errors=1539

 

接着重启数据库,发现启动报错:

160407 17:19:44  InnoDB: Initializing buffer pool, size = 1.0G
160407 17:19:44  InnoDB: Completed initialization of buffer pool
160407 17:19:45  InnoDB: Started; log sequence number 11 2950076940
/usr/local/mysql/bin/mysqld: File './mysql-bin.000039' not found (Errcode: 2)
160407 17:19:45 [ERROR] Failed to open log (file './mysql-bin.000039', errno 2)
160407 17:19:45 [ERROR] Could not open log file
160407 17:19:45 [ERROR] Can't init tc log
160407 17:19:45 [ERROR] Aborting

 

 

不知道为什么,从库上会报这个错

解决:将从库上的log-bin 注释掉了,重启成功

如果是主库这样做会有风险的

你可能感兴趣的:(MYSQL)