问题:
MySQL 报错 :Multiple files found for the same tablespace ID
同一表空间ID找到多个文件
解决办法:
1,查询数据库日志
日志默认安装位置及名称:/var/log/mysqld.log
2021-01-26 14:35:49+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-01-26 14:35:49+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-01-26 14:35:49+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2021-01-26T06:35:50.026196Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.22) starting as process 1
2021-01-26T06:35:50.036445Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-01-26T06:35:50.074544Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2021-01-26T06:35:50.074611Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 1 = ['data/sys/sys_config.ibd', 'sys/sys_config.ibd']
2021-01-26T06:35:50.074655Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967278 = ['data/undo_002', 'undo_002']
2021-01-26T06:35:50.074695Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967279 = ['data/undo_001', 'undo_001']
2021-01-26T06:35:50.074734Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967294 = ['data/mysql.ibd', 'mysql.ibd']
2021-01-26T06:35:50.074787Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2021-01-26T06:35:50.074867Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2021-01-26T06:35:50.075080Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-01-26T06:35:50.075216Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-01-26T06:35:50.075650Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.
2,根据日志提示找到问题并解决。
查看 mysql data 文件目录下是否有重复的提示文件,如果有删除即可。