MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file

本地装了 Wamp 的环境,启动时 MySQL 启动失败,查看启动失败的日志,日志如下:

2021-08-21T12:46:57.183482Z 0 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file .\ibdata1 are 0x4800!
2021-08-21 20:46:57 0xf48  InnoDB: Assertion failure in thread 3912 in file ut0ut.cc line 942
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
12:46:57 UTC - mysqld got exception 0x80000003 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

后来在网上查,很多人都是用了 MySQL 8 以后再用 MySQL 5.7 后报这个问题,然后我本地也是这种情况。后来我检查 my.ini 文件,发现其中有一项配置 datadir 的目录指向是有问题的,修改一下即可。

然后再次启动,报下面的错误:

2021-08-21T12:57:29.873841Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2021-08-21T12:57:29.874698Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2021-08-21T12:57:29.875239Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-08-21T12:57:30.090440Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-08-21T12:57:30.091251Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-08-21T12:57:30.091811Z 0 [ERROR] Failed to initialize builtin plugins.
2021-08-21T12:57:30.092185Z 0 [ERROR] Aborting

然后按照网上的方法,删掉 MySQL 安装目录下的 data 目录下的 ib_logfile0 和 ib_logfile1 即可,如果这两个文件删除不掉,那么就在进程列表中找到 mysqld 将其结束即可。

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
11天前
|
关系型数据库 MySQL 数据库
ORM对mysql数据库中数据进行操作报错解决
ORM对mysql数据库中数据进行操作报错解决
35 2
|
13天前
|
SQL 关系型数据库 MySQL
MySQL 8.0报错--1118-Row size too large. The maximum row size for the used table type, not counting BLOBs,is 8126,
MySQL 8.0报错--1118-Row size too large. The maximum row size for the used table type, not counting BLOBs,is 8126,
MySQL 8.0报错--1118-Row size too large. The maximum row size for the used table type, not counting BLOBs,is 8126,
|
6天前
|
数据采集 中间件 关系型数据库
Mac系统通过brew安装mysql5.7后,启动报错的解决办法
Mac系统通过brew安装mysql5.7后,启动报错的解决办法
18 2
|
8天前
|
SQL 关系型数据库 MySQL
9-21|mysql语句报错
9-21|mysql语句报错
|
9天前
|
关系型数据库 MySQL 数据库
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
35 0
|
5月前
|
存储 Swift
在Swift编程语言中,字典(Dictionary)
在Swift编程语言中,字典(Dictionary)
65 3
|
12月前
|
存储 Java Python
多重字典(Multi-Level Dictionary)
多重字典(Multi-Level Dictionary)是一种将多个字典组合在一起的数据结构,用于解决需要在多个维度上查找数据的问题。多重字典可以看作是一个嵌套的字典,每个字典都可以作为其他字典的键。 使用多重字典的场景:
135 3
|
5月前
|
存储 缓存 数据库连接
Python基础教程——字典(Dictionary)
Python基础教程——字典(Dictionary)
|
4月前
|
存储 Python 容器
|
4月前
|
Python 存储 容器
Python 字典(Dictionary)
Python 字典(Dictionary)
下一篇
无影云桌面