这篇文章给大家介绍如何解决mysql因为事务日志问题无法启动的问题,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

Mysql数据库无法启动,具体如下:

[root@testdb var]#service mysql start

Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/mysql.pid).

初看,好像是权限问题,但仔细检查权限,没有发现问题,所以进入错误日志看

[root@testdbvar]#moretestdb.err2020-06-12T08:30:25.273479Z0[Note]--secure-file-privissettoNULL.Operationsrelatedtoimportingandexportingdataaredisabled2020-06-12T08:30:25.273850Z0[Note]/usr/local/mysql/bin/mysqld(mysqld5.7.26-log)startingasprocess10090...2020-06-12T08:30:25.286777Z0[Note]InnoDB:PUNCHHOLEsupportavailable2020-06-12T08:30:25.286827Z0[Note]InnoDB:Mutexesandrw_locksuseGCCatomicbuiltins2020-06-12T08:30:25.286838Z0[Note]InnoDB:Useseventmutexes2020-06-12T08:30:25.286845Z0[Note]InnoDB:GCCbuiltin__atomic_thread_fence()isusedformemorybarrier2020-06-12T08:30:25.286852Z0[Note]InnoDB:Compressedtablesusezlib1.2.112020-06-12T08:30:25.286856Z0[Note]InnoDB:UsingLinuxnativeAIO2020-06-12T08:30:25.288765Z0[Note]InnoDB:Numberofpools:12020-06-12T08:30:25.288939Z0[Note]InnoDB:UsingCPUcrc32instructions2020-06-12T08:30:25.291804Z0[Note]InnoDB:Initializingbufferpool,totalsize=4G,instances=8,chunksize=128M2020-06-12T08:30:25.552835Z0[Note]InnoDB:Completedinitializationofbufferpool2020-06-12T08:30:25.589770Z0[Note]InnoDB:Ifthemysqldexecutionuserisauthorized,pagecleanerthreadprioritycanbechanged.Seethemanpageofsetpriority().2020-06-12T08:30:25.603855Z0[Note]InnoDB:HighestsupportedfileformatisBarracuda.2020-06-12T08:30:25.627920Z0[ERROR]InnoDB:IgnoringtheredologduetomissingMLOG_CHECKPOINTbetweenthecheckpoint3970243421andtheend3970243072.2020-06-12T08:30:25.627962Z0[ERROR]InnoDB:PlugininitializationabortedwitherrorGenericerror2020-06-12T08:30:26.229118Z0[ERROR]Plugin'InnoDB'initfunctionreturnederror.2020-06-12T08:30:26.229160Z0[ERROR]Plugin'InnoDB'registrationasaSTORAGEENGINEfailed.2020-06-12T08:30:26.229168Z0[ERROR]Failedtoinitializebuiltinplugins.2020-06-12T08:30:26.229172Z0[ERROR]Aborting

查看日志,发现如下:

InnoDB:IgnoringtheredologduetomissingMLOG_CHECKPOINTbetweenthecheckpoint3970243421andtheend3970243072.

事务日志有断档,估计也找不出来了,基于此,只能把原来的事务日志ib_logfile0和ib_logfile1重命名或者删除掉,然后再重新启动

[root@testdbvar]#servicemysqlstartStartingMySQL...SUCCESS!

关于如何解决mysql因为事务日志问题无法启动的问题就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。