Database 3

SpringBoot(2) - MyBatis 사용하기

*프로젝트 시작할 때, MyBatis 담아놓고 시작 1. Database 설정하기 application.properties 파일에 작성 #DataBase Setting spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://127.0.0.1:3306/testdb?serverTimezone=UTC&useUniCode=yes&characterEncoding=UTF-8 spring.datasource.username=myid spring.datasource.password=mypw 2. Mapper 생성하기 1. src/main/java내에 Mapper 클래스 생성 package com.test..

Programming/Spring 2022.06.10

[실습] MySQL 시작하기

*설치하기 2021.09.14 - [개발환경설정] - [Windows 10] MySQL 설치 [Windows 10] MySQL 설치 0. 설치 전 - 현재 사용 가능한 최신 버전 : MySQL Community 8.0 - Windows 운영체제 기준 : Windows 7 이상, Windows Server 2008 R2 이상의 버전에서 설치 가능 1. MySQL 설치 https://dev.mysql.com/downloads.. yerinpy73.tistory.com 0. MySQL 시작하기 방법1. cmd [관리자 권한으로 실행] 1) set path=%path%;C:\Program Files\MySQL\MySQL Server 8.0\bin 2) mysql -u root -p 방법2. mysql workb..

MySQL 문법

1. MySQL Data Types 1) int, smallint 2) float, double 3) char, varchar 4) date, datetime 2. database 관련 commands 1. database 생성 - create database DB이름; 2. database 삭제 - drop database DB이름; - drop database if exists DB이름; -- 해당 DB가 존재하면 삭제 3. database 사용하기 - use DB이름; 4. database들 보기 - show databases; - database들의 이름을 리스트로 보여준다. 3. table 관련 commands 1. 테이블 상세 정보 보기 - desc Table이름; 2. 특정 database에..