mariadb(mysql) 데이터베이스에 테이블이 있으나 데이터를 가져오지 못하는 현상 문의드립니다.

mariadb(mysql) 데이터베이스에 테이블이 있으나 데이터를 가져오지 못하는 현상 문의드립니다.

QA

mariadb(mysql) 데이터베이스에 테이블이 있으나 데이터를 가져오지 못하는 현상 문의드립니다.

답변 2

본문

maria db에서 데이터가 존재하는데, 웹 페이지에서 전부 초기화 된 것으로 나옵니다...

이런 현상이 주기적으로 발생하는데 이유나 조치 방법을 알 수 있을까요?

원인이나 조치방법 아시면 조언 부탁드리겠습니다.

감사합니다!

 

데이터 파일은 존재함

-----------------------------------------------------------------------------------

-rw-rw---- 1 mysql mysql    61  4월 14 09:27 db.opt
-rw-rw---- 1 mysql mysql  8642  4월 14 09:27 g5_auth.frm
-rw-rw---- 1 mysql mysql  8756  4월 14 09:27 g5_autosave.frm
-rw-rw---- 1 mysql mysql 33828  4월 14 09:27 g5_board.frm
-rw-rw---- 1 mysql mysql  9124  4월 14 09:27 g5_board_file.frm
-rw-rw---- 1 mysql mysql  8744  4월 14 09:27 g5_board_good.frm
-rw-rw---- 1 mysql mysql  8748  4월 14 09:27 g5_board_new.frm
-rw-rw---- 1 mysql mysql  8780  4월 14 09:27 g5_cert_history.frm
-rw-rw---- 1 mysql mysql 49246  4월 14 09:27 g5_config.frm
-rw-rw---- 1 mysql mysql 13160  4월 14 09:27 g5_content.frm
-rw-rw---- 1 mysql mysql  8716  4월 14 09:27 g5_faq.frm
-rw-rw---- 1 mysql mysql  8854  4월 14 09:27 g5_faq_master.frm
-rw-rw---- 1 mysql mysql 25921  4월 14 09:27 g5_group.frm
-rw-rw---- 1 mysql mysql  8670  4월 14 09:27 g5_group_member.frm
-rw-rw---- 1 mysql mysql  8716  4월 14 09:27 g5_login.frm
-rw-rw---- 1 mysql mysql  8764  4월 14 09:27 g5_mail.frm
-rw-rw---- 1 mysql mysql 31190  4월 14 09:27 g5_member.frm
-rw-rw---- 1 mysql mysql 13080  4월 14 09:27 g5_member_social_profiles.frm
-rw-rw---- 1 mysql mysql  8934  4월 14 09:27 g5_memo.frm
-rw-rw---- 1 mysql mysql  8830  4월 14 09:27 g5_menu.frm
-rw-rw---- 1 mysql mysql  9032  4월 14 09:27 g5_new_win.frm
-rw-rw---- 1 mysql mysql  9034  4월 14 09:27 g5_point.frm
-rw-rw---- 1 mysql mysql 17724  4월 14 09:27 g5_poll.frm
-rw-rw---- 1 mysql mysql  8742  4월 14 09:27 g5_poll_etc.frm
-rw-rw---- 1 mysql mysql  8666  4월 14 09:27 g5_popular.frm
-rw-rw---- 1 mysql mysql 22506  4월 14 09:27 g5_qa_config.frm
-rw-rw---- 1 mysql mysql 21870  4월 14 09:27 g5_qa_content.frm
-rw-rw---- 1 mysql mysql  8708  4월 14 09:27 g5_scrap.frm
-rw-rw---- 1 mysql mysql  8594  4월 14 09:27 g5_uniqid.frm
-rw-rw---- 1 mysql mysql 12956  4월 14 09:27 g5_visit.frm
-rw-rw---- 1 mysql mysql  8604  4월 14 09:27 g5_visit_sum.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_admin.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_bloomberg.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_free.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_gallery.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_introduce.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_invest.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_my_diary.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_my_rule.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_my_strategy.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_my_think.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_notice.frm
-rw-rw---- 1 mysql mysql 26558  4월 14 09:27 g5_write_qa.frm
-rw-rw---- 1 mysql mysql 12944  4월 14 09:27 sms5_book.frm
-rw-rw---- 1 mysql mysql  8802  4월 14 09:27 sms5_book_group.frm
-rw-rw---- 1 mysql mysql  8612  4월 14 09:27 sms5_config.frm
-rw-rw---- 1 mysql mysql  8756  4월 14 09:27 sms5_form.frm
-rw-rw---- 1 mysql mysql  8676  4월 14 09:27 sms5_form_group.frm
-rw-rw---- 1 mysql mysql 13110  4월 14 09:27 sms5_history.frm
-rw-rw---- 1 mysql mysql  8968  4월 14 09:27 sms5_write.frm

-----------------------------------------------------------------------------------

 

데이터베이스 점검 시

-----------------------------------------------------------------------------------

$ mysqlcheck -uroot -p --check --database antland_db
Enter password:
antland_db.g5_auth
Error    : Table 'antland_db.g5_auth' doesn't exist
status   : Operation failed
antland_db.g5_autosave
Error    : Table 'antland_db.g5_autosave' doesn't exist
status   : Operation failed
antland_db.g5_board
Error    : Table 'antland_db.g5_board' doesn't exist
status   : Operation failed
antland_db.g5_board_file
Error    : Table 'antland_db.g5_board_file' doesn't exist
status   : Operation failed
antland_db.g5_board_good
Error    : Table 'antland_db.g5_board_good' doesn't exist
status   : Operation failed
antland_db.g5_board_new
Error    : Table 'antland_db.g5_board_new' doesn't exist
status   : Operation failed
antland_db.g5_cert_history
Error    : Table 'antland_db.g5_cert_history' doesn't exist
status   : Operation failed
antland_db.g5_config
Error    : Table 'antland_db.g5_config' doesn't exist
status   : Operation failed
antland_db.g5_content
Error    : Table 'antland_db.g5_content' doesn't exist
status   : Operation failed
antland_db.g5_faq
Error    : Table 'antland_db.g5_faq' doesn't exist
status   : Operation failed
antland_db.g5_faq_master
Error    : Table 'antland_db.g5_faq_master' doesn't exist
status   : Operation failed
antland_db.g5_group
Error    : Table 'antland_db.g5_group' doesn't exist
status   : Operation failed
antland_db.g5_group_member
Error    : Table 'antland_db.g5_group_member' doesn't exist
status   : Operation failed
antland_db.g5_login
Error    : Table 'antland_db.g5_login' doesn't exist
status   : Operation failed
antland_db.g5_mail
Error    : Table 'antland_db.g5_mail' doesn't exist
status   : Operation failed
antland_db.g5_member
Error    : Table 'antland_db.g5_member' doesn't exist
status   : Operation failed
antland_db.g5_member_social_profiles
Error    : Table 'antland_db.g5_member_social_profiles' doesn't exist
status   : Operation failed
antland_db.g5_memo
Error    : Table 'antland_db.g5_memo' doesn't exist
status   : Operation failed
antland_db.g5_menu
Error    : Table 'antland_db.g5_menu' doesn't exist
status   : Operation failed
antland_db.g5_new_win
Error    : Table 'antland_db.g5_new_win' doesn't exist
status   : Operation failed
antland_db.g5_point
Error    : Table 'antland_db.g5_point' doesn't exist
status   : Operation failed
antland_db.g5_poll
Error    : Table 'antland_db.g5_poll' doesn't exist
status   : Operation failed
antland_db.g5_poll_etc
Error    : Table 'antland_db.g5_poll_etc' doesn't exist
status   : Operation failed
antland_db.g5_popular
Error    : Table 'antland_db.g5_popular' doesn't exist
status   : Operation failed
antland_db.g5_qa_config
Error    : Table 'antland_db.g5_qa_config' doesn't exist
status   : Operation failed
antland_db.g5_qa_content
Error    : Table 'antland_db.g5_qa_content' doesn't exist
status   : Operation failed
antland_db.g5_scrap
Error    : Table 'antland_db.g5_scrap' doesn't exist
status   : Operation failed
antland_db.g5_uniqid
Error    : Table 'antland_db.g5_uniqid' doesn't exist
status   : Operation failed
antland_db.g5_visit
Error    : Table 'antland_db.g5_visit' doesn't exist
status   : Operation failed
antland_db.g5_visit_sum
Error    : Table 'antland_db.g5_visit_sum' doesn't exist
status   : Operation failed
antland_db.g5_write_admin
Error    : Table 'antland_db.g5_write_admin' doesn't exist
status   : Operation failed
antland_db.g5_write_bloomberg
Error    : Table 'antland_db.g5_write_bloomberg' doesn't exist
status   : Operation failed
antland_db.g5_write_free
Error    : Table 'antland_db.g5_write_free' doesn't exist
status   : Operation failed
antland_db.g5_write_gallery
Error    : Table 'antland_db.g5_write_gallery' doesn't exist
status   : Operation failed
antland_db.g5_write_introduce
Error    : Table 'antland_db.g5_write_introduce' doesn't exist
status   : Operation failed
antland_db.g5_write_invest
Error    : Table 'antland_db.g5_write_invest' doesn't exist
status   : Operation failed
antland_db.g5_write_my_diary
Error    : Table 'antland_db.g5_write_my_diary' doesn't exist
status   : Operation failed
antland_db.g5_write_my_rule
Error    : Table 'antland_db.g5_write_my_rule' doesn't exist
status   : Operation failed
antland_db.g5_write_my_strategy
Error    : Table 'antland_db.g5_write_my_strategy' doesn't exist
status   : Operation failed
antland_db.g5_write_my_think
Error    : Table 'antland_db.g5_write_my_think' doesn't exist
status   : Operation failed
antland_db.g5_write_notice
Error    : Table 'antland_db.g5_write_notice' doesn't exist
status   : Operation failed
antland_db.g5_write_qa
Error    : Table 'antland_db.g5_write_qa' doesn't exist
status   : Operation failed
antland_db.sms5_book
Error    : Table 'antland_db.sms5_book' doesn't exist
status   : Operation failed
antland_db.sms5_book_group
Error    : Table 'antland_db.sms5_book_group' doesn't exist
status   : Operation failed
antland_db.sms5_config
Error    : Table 'antland_db.sms5_config' doesn't exist
status   : Operation failed
antland_db.sms5_form
Error    : Table 'antland_db.sms5_form' doesn't exist
status   : Operation failed
antland_db.sms5_form_group
Error    : Table 'antland_db.sms5_form_group' doesn't exist
status   : Operation failed
antland_db.sms5_history
Error    : Table 'antland_db.sms5_history' doesn't exist
status   : Operation failed
antland_db.sms5_write
Error    : Table 'antland_db.sms5_write' doesn't exist
status   : Operation failed
-----------------------------------------------------------------------------------

 

DB 접속해서 확인 시

-----------------------------------------------------------------------------------

MariaDB [antland_db]> show tables;
+---------------------------+
| Tables_in_antland_db      |
+---------------------------+
| g5_auth                   |
| g5_autosave               |
| g5_board                  |
| g5_board_file             |
| g5_board_good             |
| g5_board_new              |
| g5_cert_history           |
| g5_config                 |
| g5_content                |
| g5_faq                    |
| g5_faq_master             |
| g5_group                  |
| g5_group_member           |
| g5_login                  |
| g5_mail                   |
| g5_member                 |
| g5_member_social_profiles |
| g5_memo                   |
| g5_menu                   |
| g5_new_win                |
| g5_point                  |
| g5_poll                   |
| g5_poll_etc               |
| g5_popular                |
| g5_qa_config              |
| g5_qa_content             |
| g5_scrap                  |
| g5_uniqid                 |
| g5_visit                  |
| g5_visit_sum              |
| g5_write_admin            |
| g5_write_bloomberg        |
| g5_write_free             |
| g5_write_gallery          |
| g5_write_introduce        |
| g5_write_invest           |
| g5_write_my_diary         |
| g5_write_my_rule          |
| g5_write_my_strategy      |
| g5_write_my_think         |
| g5_write_notice           |
| g5_write_qa               |
| sms5_book                 |
| sms5_book_group           |
| sms5_config               |
| sms5_form                 |
| sms5_form_group           |
| sms5_history              |
| sms5_write                |
+---------------------------+
 

MariaDB [antland_db]> select * from g5_write_bloomberg;
ERROR 1146 (42S02): Table 'antland_db.g5_write_bloomberg' doesn't exis

-----------------------------------------------------------------------------------

 

이 질문에 댓글 쓰기 :

답변 2

테이블이 있으나 데이터를 못가져온다면

data/db.config.php 파일에서

db 접두사를 확인해보세요.

답변 감사합니다. 근데 DB 클라이언트 툴로 접속했을 때도 데이터 사이즈가 0으로 나오고 테이블이 아무것도 안보입니다...데이터베이스 자체가 문제가 있는것 같아요.ㅠㅠ;

원인 찾았습니다~

DB 엔진이 InnoDB 였는데, ib_logfile0,ibdata1,ib_logfile1 파일이 삭제되어 문제가 되었습니다...

단순 로그파일로만 생각했는데, InnoDB 사용시에는 중요한 파일들이네요..;

쇼핑몰하고 커뮤니티 사이트 2개 운영중인데...
DB가 중간에 업그레이드 되면서 신규 커뮤니티만 InnoDB로 되어 있었나 봅니다.
영카트 업그레이드 과정에서 DB가 꼬여버려서 문제가 있었는데, 그때 조치하다가 삭제한듯 하네요^^;;;엔진에 대해서는 잘 몰랐는데, 그 부분도 신경써야 될듯 합니다.ㅎㅎ

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 61,332
© SIRSOFT
현재 페이지 제일 처음으로