marsboard中mysql故障处理

故障现象:

报错:
root@marsboard:~# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

应该是MySQL没有启动,执行命令启动:
root@marsboard:~# service mysql start
启动报错:
start: Job failed to start

进入/var/log/mysql/error.log查看错误日志:
210528 12:38:30 [Note] Plugin 'FEDERATED' is disabled.
210528 12:38:30 InnoDB: The InnoDB memory heap is disabled
210528 12:38:30 InnoDB: Mutexes and rw_locks use GCC atomic builtins
210528 12:38:30 InnoDB: Compressed tables use zlib 1.2.8
210528 12:38:30 InnoDB: Using Linux native AIO
210528 12:38:30 InnoDB: Initializing buffer pool, size = 128.0M
210528 12:38:30 InnoDB: Completed initialization of buffer pool
210528 12:38:30 InnoDB: highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html
210528 12:38:30 [ERROR] Plugin 'InnoDB' init function returned error.
210528 12:38:30 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
210528 12:38:30 [ERROR] Unknown/unsupported storage engine: InnoDB
210528 12:38:30 [ERROR] Aborting

210528 12:38:30 [Note] /usr/sbin/mysqld: Shutdown complete

找到第一个【error】:Plugin 'InnoDB' init function returned error.经查找资料,删除/var/lib/mysql下以下两个文件即可:
ib_logfile0 ib_logfile1

删除后再次执行:
root@marsboard:~# service mysql start

启动成功:
mysql start/running, process 5587