IT

InnoDB의 손상된 데이터 구조를 수정하는 방법

itgroup 2022. 11. 7. 21:29
반응형

InnoDB의 손상된 데이터 구조를 수정하는 방법

mysql을 삭제하고 mariadb를 설치했는데, mysql을 삭제하면 InnoDB가 망가진 것 같습니다.

InnoDB: Plugin initialization aborted with error Data structure corruption

전체 로그:

    -- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- 
-- Unit mariadb.service has begun starting up.
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.8-MariaDB) starting as process 6137 ...
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32183)
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] InnoDB: Using Linux native AIO
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] InnoDB: Uses event mutexes
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] InnoDB: Number of pools: 1
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] InnoDB: Completed initialization of buffer pool
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed>
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
Jan 16 18:25:55 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:55 0 [Note] InnoDB: Starting shutdown...
Jan 16 18:25:56 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:56 0 [ERROR] Plugin 'InnoDB' init function returned error.
Jan 16 18:25:56 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:56 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Jan 16 18:25:56 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:56 0 [Note] Plugin 'FEEDBACK' is disabled.
Jan 16 18:25:56 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:56 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be n>
Jan 16 18:25:56 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:56 0 [ERROR] Unknown/unsupported storage engine: InnoDB
Jan 16 18:25:56 CentOSVPS1.DylanMediaPC mariadbd[6137]: 2021-01-16 18:25:56 0 [ERROR] Aborting
Jan 16 18:25:56 CentOSVPS1.DylanMediaPC systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 18:25:56 CentOSVPS1.DylanMediaPC systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support

편집1: 아래 투고에 따르면, mysql과 mariadb에 "플러그인"으로 알려진 InnoDB 구현이 포함되어 있습니다.그럼 mariadb를 다시 설치하면 innodb를 고칠 수 있나요?

https://dev.mysql.com/doc/refman/5.5/en/innodb-installation.html

MySQL 5.5 이상에서 InnoDB 스토리지 엔진 1.1 이상을 사용하는 경우 특별한 설치 작업이 필요하지 않습니다. 모든 것이 MySQL 소스 및 이진 배포의 일부로 구성되어 제공됩니다.

편집 2: 사용yum history undomariadb 설치, mysql 제거 및 mysql 설치.다음으로 mariadb를 설치했습니다.이로 인해 문제가 해결되지는 않았지만 사용되지 않는 mysql 의존관계가 해소되었습니다.

Edit 3: 다음 게시물에서 다음 명령을 실행하면 문제가 해결되었습니다.

sudo rm -rf /var/lib/mysql/*
sudo mysql_install_db -u mysql

https://dba.stackexchange.com/questions/275885/innodb-failing-to-start-mysql-not-loading-plugins

Edit 3: 다음 게시물에서 다음 명령을 실행하면 문제가 해결되었습니다.

sudo rm -rf /var/lib/mysql/*
sudo mysql_install_db -u mysql

https://dba.stackexchange.com/questions/275885/innodb-failing-to-start-mysql-not-loading-plugins

mysql을 삭제하고 mariadb를 설치해도 같은 문제가 발생하였습니다.mariadb를 시작하기 전에 모든 mysql 파일을 삭제해야 했습니다.

sudo rm /var/lib/mysql-files /var/lib/mysql-keyring
sudo rm -rf /var/lib/mysql/*

언급URL : https://stackoverflow.com/questions/65753443/how-to-fix-innodb-corrupted-data-structure

반응형