如果Mysql启动报错:
[root@controller1 ~]# systemctl restartmariadb
Job for mariadb.service failed because thecontrol process exited with error code. See "systemctl statusmariadb.service" and "journalctl -xe" for details.
Journalctl –f查看到有如下信息:
Jun 20 10:15:22 controller1mysqld_safe[14538]: 160620 10:15:22 [ERROR] Found 1 prepared transactions! Itmeans that mysqld was not shut down properly last time and critical recoveryinformation (last binlog or tc.log file) was manually deleted after a crash.You have to start mysqld with --tc-heuristic-recover switch to commit orrollback pending transactions.
Jun 20 10:15:22 controller1 mysqld_safe[14538]:160620 10:15:22 [ERROR] Aborting
Jun 20 10:15:22 controller1mysqld_safe[14538]: 160620 10:15:22 InnoDB: Starting shutdown...
Jun 20 10:15:22 controller1mysqld_safe[14538]: 160620 10:15:22 InnoDB: Shutdown completed; log seque