문제
스프링 부트 학습 중 db를 연결하여 실행시키는 과정에서 에러가 발생했다. https://ewok.tistory.com/358
No database selected라는 것으로 보아 db 정보가 누락된 것 같다.
spring.datasource.url=jdbc:mariadb://localhost:3306
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=1234
spring.jpa.show-sql=true
위 코드가 application.properties인데 url에 db가 선택되지 않았다.
해결
아래와 같이 db정보를 추가하여 해결하였다.
spring.datasource.url=jdbc:mariadb://localhost:3306/hello-spring
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=1234
spring.jpa.show-sql=true