본문 바로가기
Laravel/Docker

*Docker 오류) SQLSTATE[42S02]: Base table or view not found

by Sein_ 2023. 10. 25.
728x90

오류 발생

오류원인:

Docker 버전 문제로 가끔 DB 를 읽어오지 못하는 문제가 있다.

 

해결방법:

(1) 오류가 일어났을 것 같은 파일을 try catch 문으로 감싸주고 오류내용을 체크

(2) 오류내용 확인

SQLSTATE[42S02]: Base table or view not found

Illuminate\Database\QueryException {#3433 ▼ // - Controller.php:432
  #message: "SQLSTATE[42S02]: Base table or view not found: 1932 Table '비밀' doesn't exist in engine (SQL: select * from `비밀` where `비밀`.`Bkid` in (1 ▶"
  #code: "42S02"
  #file: "- Connection.php"
  #line: 760
  -previous: PDOException {#3443 ▶}
  +errorInfo: array:3 [▶]
  #sql: "select * from `비밀` where `비밀`.`Bkid` in (비밀)"
  #bindings: []
  trace: {▶}
}

(3) Docker 세팅에 들어가서 General > VirtioFS (최신 버전) 에서 osxfs(Legacy) (이전버전) 변경

 

*이거 무슨 내용인지 분석하기!!