ps:windows下的mariadb版本10.1.9
问题1
mysql启动不了,不能初始化tc日志,导致数据库mariadb启动失败
[Note] Recovering after a crash using tc.log
[ERROR] Can't init tc log
[ERROR] Aborting
解决
FIX:
linux:rm /var/lib/mysql/tc.log
windows:删除mysq下的data文件夹中的tc.log
Then:
重启mysql服务:sudo service mysql start
原因
tc.log is the distributed transaction (XA) log coordinator, which is created by a fresh installation of MariaDB, not in Oracle MySQL.
tc_log是事务协调器日志,用于协调影响多个具有XA功能的存储引擎的事务。如果启用了两个或更多具有XA功能的存储引擎,则事务协调器日志必须可用
在咱们的程序中使用了分布式事务,数据库引擎是InnoDB,使用的是基于内存映射和文件的事务处理协调器日志,其主要目的之一是崩溃修复( crash recovery)
但如果服务器崩溃了,并且你更改了加载的支持XA的存储引擎的数量,也就是出现以下问题:
2018-11-30 23:08:49 140046048638848 [Note] Recovering after a crash using tc.log
2018-11-30 23:08:49 140046048