Mysql 자료실
Vote Reply Modify Delete Forward Prev Next List

  작성자   : 조성환 [ ladmin ] 추천: 247, 수정: 1, 조회: 1176, 줄수: 99, 분류: Etc.
marked as crashed and should be repaired 에러 날때
mysqldump: Got error: 145: Table './user/DB명' is marked as crashed and should be repaired when using LOCK TABLES

라는 에러가 날 때가 있습니다.

다음과 같이 해당 테이블을 repair 하시면 바로 해결됩니다.!!



# mysqldump -u root -p [DB명] > [DB명]

# mysqldump: Got error: 145: Table './user/DB명' is marked as crashed and should be repaired when using LOCK TABLES

에러발생

# mysqldump -u root -p DBname --lock-table=0 > backup.sql

이런식으로 다시 백업

- 도중 DB 손상되었다고 에러뜨면



# 디비접속

# use [디비명];

#repair table [손상된테이블];



하고 다시진행





<실제 작업 !!>

DB 백업 도중 table xe_session 이 Crash 났다고 에러 나서 다음과 같이 실행하여 처리함


[down:/] #   mysql -uroot -p********

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 668614
Server version: 5.1.60 Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> show databases ;

+---------------------+
| Database            |
+---------------------+
| information_schema  |
| db_acaedu_www       |
| db_jfriends_www     |
| db_pansori_www      |
| db_project_cambodia |
| db_project_comc     |
| db_project_edu      |
| db_project_support  |
| db_project_webzine  |
| db_project_www      |
| db_project_www2     |
| mysql               |
| test                |
+---------------------+
13 rows in set (0.08 sec)


mysql> use db_jfriends_www ;

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed


mysql> repair table xe_session ;

+----------------------------+--------+----------+----------+
| Table                      | Op     | Msg_type | Msg_text |
+----------------------------+--------+----------+----------+
| db_jfriends_www.xe_session | repair | status   | OK       |
+----------------------------+--------+----------+----------+
1 row in set (1.91 sec)

mysql>


이전: XE 로그인이 안되면서 DB 로그에 table 복구하라는 메시지가 쌓였을때 해결 방법
다음: MYSQL - innoDB 의 Transaction(트랜잭션) 의 개념 및 설정
2015/09/06(14:44) from 59.29.152.10
CrazyWWWBoard 2000

Vote Reply Modify Delete Forward Prev Next List
(c) Nobreak Technologies, Inc.