[스프링부트 with JPA 블로그 3강] MySQL 한글 설정 및 연결

최희정·2022년 9월 5일
2

1. 사용자 생성 및 권한 주기 및 DB 생성

-- 유저이름@아이피주소
create user 'cxxerry'@'%' identified by '비밀번호입력';
-- ON DB이름.테이블명
-- TO 유저이름@아이피주소
GRANT ALL PRIVILEGES ON . TO 'cxxerry'@'%';
CREATE DATABASE blog CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use blog;

2. 한글 설정 확인

show variables like 'c%';

3. MySQL 프로젝트 연결

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: cxxerry
password: chlgmlwjd01!

profile
차근차근 일상을 기록하는 컴공생 👩🏻‍💻

1개의 댓글

comment-user-thumbnail
2022년 9월 11일
답글 달기