龙空技术网

mysql数据库启动失败处理

阿德的南京生活 46

前言:

现在同学们对“sumysql”大概比较关心,小伙伴们都需要剖析一些“sumysql”的相关知识。那么小编也在网上汇集了一些关于“sumysql””的相关文章,希望兄弟们能喜欢,小伙伴们快快来学习一下吧!

启动运行于linux环境上的mysql数据库失败,导致业务无法正常进行。对此问题进行排查,手动去启动mysql数据库。启动过程如下:

1.进入mysql数据库所在的linux用户

su - ebaserdb

2.使用tailf查看mysql数据库启动过程中的日志

tailf /home/ebaserdb/log/mysqld1.log

3.使用启动命令来执行mysql数据库的启动

mysql.server start

然后观察数据库日志在启动过程中的数据:

2018-12-04T06:27:41.500719Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.2018-12-04T06:27:41.500828Z 0 [Note] /home/ebaserdb/bin/xpecd (mysqld 5.7.21) starting as process 34409 ...2018-12-04T06:27:41.561369Z 0 [Note] InnoDB: PUNCH HOLE support not available2018-12-04T06:27:41.561439Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2018-12-04T06:27:41.561451Z 0 [Note] InnoDB: Uses event mutexes2018-12-04T06:27:41.561461Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier2018-12-04T06:27:41.561469Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.32018-12-04T06:27:41.562166Z 0 [Note] InnoDB: Number of pools: 12018-12-04T06:27:41.562310Z 0 [Note] InnoDB: Using CPU crc32 instructions2018-12-04T06:27:41.570436Z 0 [Note] InnoDB: Initializing buffer pool, total size = 640M, instances = 1, chunk size = 128M2018-12-04T06:27:41.620035Z 0 [Note] InnoDB: Completed initialization of buffer pool2018-12-04T06:27:41.627187Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().2018-12-04T06:27:41.651735Z 0 [Note] InnoDB: Highest supported file format is Barracuda.2018-12-04T06:27:41.655370Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 6780558137 and the end 6780557824.2018-12-04T06:27:41.655408Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error2018-12-04T06:27:41.955745Z 0 [ERROR] Plugin 'InnoDB' init function returned error.2018-12-04T06:27:41.955783Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.2018-12-04T06:27:41.955793Z 0 [ERROR] Failed to initialize builtin plugins.2018-12-04T06:27:41.955798Z 0 [ERROR] Aborting2018-12-04T06:27:41.955813Z 0 [Note] Binlog end2018-12-04T06:27:41.955873Z 0 [Note] Shutting down plugin 'MyISAM'2018-12-04T06:27:41.955895Z 0 [Note] Shutting down plugin 'CSV'2018-12-04T06:27:41.956982Z 0 [Note] /home/ebaserdb/bin/xpecd: Shutdown complete

可以看到ERROR的报错

ERROR报错信息

这种报错多是因为机器异常断点导致InnoDB的事务日志文件ib_logfile0、ib_logfile1出现问题,在该日志比较大(比数据文件大)的时候可以用来恢复数据(成功率没保证)。

因此本问题的处理方式是将这两个日志文件重命名或者移到其他目录中:

mv /home/ebaserdb/data/redo/ib_logfile0 /home

mv /home/ebaserdb/data/redo/ib_logfile1 /home

然后重新启动数据库,就不会出现报错。

注意:

如果可能需要数据恢复,那么只需要保留原始的InnoDB日志文件以便后面需要的恢复操作。 如果MySQL服务器在上述过程之后成功启动,并且所有数据都完好无损,则可以丢弃原始的InnoDB日志文件,mysql成功启动之后会重新创建适当大小的新InnoDB日志文件。

标签: #sumysql #mysqllinux启动不了 #启动mysql数据库服务无法启动 #启动mysql数据库服务无法启动怎么办 #无法启动服务mysql服务无法启动