MySQL Error Code: 1046. No database selected Select the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar.

 

 

Error

  • 테이블에 insert문을 사용하였더니 에러 출력
insert into testtable (id) values (1);

 

  • Error Code: 1046
Error Code: 1046.
No database selected Select the default DB to be used by double-clicking
its name in the SCHEMAS list in the sidebar.

해결 방법

  • 말 그대로 데이터베이스가 선택되지 않았기 때문
  • 사용할 데이터베이스를 선택

 

  • 스키마 목록

 

  • use DatabaseName : 해당 디비 사용
use test;

 

  • 값 입력 재시도
insert into testtable (id) values (1);

 

  • 수행 성공