- 관련 링크 : https://www.digitalocean.com/community/tutorials/how-to-fix-corrupted-tables-in-mysql
- 관련 링크: https://stackoverflow.com/questions/57128891/how-repair-corrupt-xampp-mysql-user-table
#1. 원인
때때로 MySQL의 테이블들은 손상될 수 있는데, 해당 오류의 내용은 해당 테이블의 데이터를 읽을 수 없게 되었기 때문이다. 그 원인으로서는 하기 이유들이 있을 수 있다.
관련링크 원문
Some common causes of corrupted tables are: The MySQL server stops in middle of a write. An external program modifies a table that’s simultaneously being modified by the server. The machine is shut down unexpectedly. The computer hardware fails. There’s a software bug somewhere in the MySQL code.
#1. 해결
로컬환경 기준으로 작성하였다.
# MYSQL QUERY
CHECK TABLE `테이블명`;
REPAIR TABLE `테이블명`;
상기와 같이 REPAIR TABLE '테이블이름'을 입력하면 하기 상태가 REPAIR로 바뀐것을 확인할 수 있다.
#1. 원인
해당 오류는 MariaDB에서 흔히 보이는 버그로서 root유저의 비밀번호를 변경함으로 문제가 야기된다.
해당 문제의 상세는 https://community.apachefriends.org/f/viewtopic.php?f=16&t=78295 에서 확인할 수 있다.
#2. 해결
관련링크 원문
Quickest way out of the swamp is just to go to step 9.
(1) Find 'my.ini' (eg. c:\xampp\mysql\bin\my.ini )
(2) Insert 'skip-grant-tables' in a new line following label '[mysqld]'. Remove this later.
(3) Now mySQL can be started from the XAMPP control panel.
(4) Start phpMyAdmin from browser and select table 'user' from database 'mysql'
(5) Should see: #1034 Index for table 'user' is corrupt; try to repair it.
(6) Select 'mysql' from left panel then check 'user' in right hand panel.
(7) From the 'With selected' dropdown run 'analyze' then 'repair table'.
(8) If 'Repair' fails no choice but to 'DROP TABLE user' ....
(9) Recreate 'user' table from the distribution backup by copying the following 3 files.
C:\xampp\mysql\backup\mysql\user.frm C:\xampp\mysql\backup\mysql\user.MYD C:\xampp\mysql\backup\mysql\user.MYI to C:\xampp\mysql\data\mysql\ then restarting XAMPP and adding/removing/editing users as you wish.
상기의 단계를 따라가면 해결 할 수 있다.
#3. 해결
해결 1, 2 를 하여도 문제를 해결 할 수 없으면 xampp 혹은 mysql을 재설치 할 것을 권장한다.
'Language > mySQL' 카테고리의 다른 글
공부 내용 정리 mySQL :: 트랜잭션(Transaction) (0) | 2021.07.31 |
---|---|
공부 내용 정리 mySQL :: 기초 VII (0) | 2021.05.22 |
공부 내용 정리 mySQL :: 초급 I (0) | 2021.05.22 |
공부 내용 정리 mySQL :: 예제 정리 4 (0) | 2021.05.20 |
공부 내용 정리 mySQL :: 기초 VI (0) | 2021.05.19 |