IT 언어/IntelliJ

[IntelliJ] MySQL 연동 (Failed to configure a DataSource: 'url' attribute is not specified ...)

비둘기멋지게발차기 2024. 7. 19. 23:01

 

처음 IntelliJ에 프로젝트를 생성해서 실행을 하면 위와 같이 에러 메세지가 나온다

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. 

에서 볼 수 있듯, DB 연결이 되지 않아서 발생하는 에러

 

 

 

 

 목차

  1. MySQL 연동
    1. MySQL Workbench에 데이터베이스 생성
    2. IntelliJ의 application.yml 설정
  2. Hello World 띄우기
    1. controller/HelloController 
    2. resources/templates/hello.html

 

 

 

1. MySQL 연동

  1. MySQL Workbench에 데이터베이스 생성
  2. IntelliJ의 application.yml 설정
  3. 정상 작동 확인

 

MySQL Workbench에 데이터베이스 생성

 

IntelliJ의 application.yml 설정

 

정상 작동 확인

 

 

2. Hello World 띄우기

  1. controller/HelloController
  2. resources/templates/hello.html
  3. 정상 작동 확인

 

controller/HelloController

 

resources/templates/hello.html

 

정상 작동 확인