Digking's cave

My First Blog Project (2) : 프로젝트 생성 및 프로젝트 환경세팅 본문

Spring/My First Blog Project

My First Blog Project (2) : 프로젝트 생성 및 프로젝트 환경세팅

디깅 2022. 12. 9. 15:03
728x90

1. Java 설치

java 11.0.17 2022-10-18 LTS 설치

 

2. MySQL 설치

mysql-installer-community-8.0.31.0 설치

 

3. Tool 설치

기존에 사용하던 IntellJ 그대로 사용

 

4. SpringBoot 프로젝트 생성

 

5. 프로젝트 설치 후 dependency 추가

<!-- 시큐리티 태그 라이브러리 -->
<dependency>
  <groupId>org.springframework.security</groupId>
  <artifactId>spring-security-taglibs</artifactId>
</dependency>

<!-- JSP 템플릿 엔진 -->
<dependency>
  <groupId>org.apache.tomcat.embed</groupId>
  <artifactId>tomcat-embed-jasper</artifactId>
</dependency>

<!-- JSTL -->
<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>jstl</artifactId>
</dependency>

 

6. MYSQL 설정

6-1. 한글 설정

6.2 사용자 생성 및 권한 주기 & DB생성

-- 유저이름@아이피주소
create user 'cos'@'%' identified by 'cos1234';
-- ON DB이름.테이블명
-- TO 유저이름@아이피주소
GRANT ALL PRIVILEGES ON *.* TO 'cos'@'%';
CREATE DATABASE blog CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use blog;

6.3 프로젝트와 연결

src/main/resources/application.yml 에 아래 내용 추가

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/blog?serverTimezone=Asia/Seoul
    username: username
    password: password
반응형