记录数据库无法启动mariadbd: Can't lock aria control file

By | 2023 年 9 月 6 日

BT面板,装了mariadbd10.7版本,经查无法启动
日志如下:

[ERROR] InnoDB: Missing FILE_CHECKPOINT at 74151423635 between the checkpoint 74151423635 and the end 74152982204.
[ERROR] InnoDB: Plugin initialization aborted with error Generic error

测试有效的方案如下:

配置中增加 innodb_force_recovery = 6 进行只读启动

[mysqld]
port		= 3306
socket		= /tmp/mysql.sock
datadir = /www/server/data
default_storage_engine = InnoDB
performance_schema_max_table_instances = 400
table_definition_cache = 400
skip-external-locking
key_buffer_size = 64M
max_allowed_packet = 100G
table_open_cache = 256
sort_buffer_size = 1M
net_buffer_length = 4K
read_buffer_size = 1M
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 16M
thread_cache_size = 32
query_cache_size = 32M
tmp_table_size = 64M
sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
innodb_force_recovery = 6

启动后,备份数据库,然后删除所有数据库。(暂时未测试其它方法)

然后关闭数据库,删除如下文件
cd /www/server/data
rm -f aria_log.00000001 aria_log_control ib_logfile0

将数据库配置文件还原,或者改为innodb_force_recovery = 1

启动mariadbd ,恢复数据

发表回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据