翻了一通帖子,终于再次连上了mysql,小激动,记录下
起因: 在同步大量数据时,导致mysql日志记录文件占满了磁盘,无法连接
1,reset master来清空日志文件,但卡主了,然后依旧连不上
2,手动删除日志文件,依旧连不上
3,发现mysql进程起来的,命令关闭不掉,直接kill,启动服务失败
4,提示找不到socket,对应目录下是没有mysql.soct,执行mysqld_save说可以重建mysql.sock,但没有重建,但提示err日志文件
5,之前在mysqld.log没有看到错误日志,现在cat .err 发现[ERROR] You need to use --log-bin to make --binlog-format wor,没想到还有这么个日志记录这个有用的信息
6,告诉
/etc/my.cnf 文件中的
log-bin=mysql-bin ,但是没有注释掉binlog_format 这条
解决办法:编辑my.cnf文件,将binlog_format 这条注释掉.
7,再次执行,果然不报错了,但现在和开始 启动一样了,执行没反应,再次看err日志
8,InnoDB: Trx id counter is 0 32256
InnoDB: Starting in background the rollback of uncommitted transactions
180506 10:05:55 InnoDB: Rollback of non-prepared transactions completed
180506 10:05:55 InnoDB: Started; log sequence number 3 1701405268
180506 10:05:55 InnoDB: Starting recovery for XA transactions...
180506 10:05:55 InnoDB: Transaction 0 22913 in prepared state after recovery
180506 10:05:55 InnoDB: Transaction contains changes to 235211 rows
180506 10:05:55 InnoDB: 1 transactions in prepared state after recovery
180506 10:05:55 [Note] Found 1 prepared transaction(s) in InnoDB
9,感觉在执行了,找了下,有个处理方式
直接删除mysql/data/ib_logfile0 ib_logfile1 文件
10,管用,咱一天没连上的mysql,终于又让我连了,感谢伙伴们的帖子