Sun-Choi / spring

0 stars 0 forks source link

MySQL 설치 #1

Open Sun-Choi opened 5 years ago

Sun-Choi commented 5 years ago

해당 페이지에서 운영체제 선택

MySQL Communnity Server

https://dev.mysql.com/downloads/mysql/

Windows10용

https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-8.0.16.0.msi

참고

https://tychejin.tistory.com/15 해당 블로그를 참고

Sun-Choi commented 5 years ago

windows에서 특정 포트 확인하여 종료하기 (3306이 사용중이어서 보니 mysql을 예전에 써둔듯)

$ netstat -nao | findstr 3306
  TCP    127.0.0.1:3306         0.0.0.0:0              LISTENING       4336

$ tasklist | findstr 4336
  mysqld.exe                    4336 Services                   0      1,996 K

(관리자 권한으로 실행)
> taskkill /f /pid 4336
성공 : 프로세스<PID 4336>가 종료되었습니다.
Sun-Choi commented 5 years ago
Java connector

https://dev.mysql.com/downloads/connector/j/ https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.16.zip

참고

https://heather-hm.tistory.com/2 해당 블로그 참고

mysql 접근 허용

https://walkingfox.tistory.com/66 방화벽 설정 https://stackoverflow.com/questions/50177216/how-to-grant-all-privileges-to-root-user-in-mysql-8-0/50197630 grant 명령어

mysql 계정 생성

권한 = 전체, id = choi

jdbc connection test

Database : spring URL : jdbc:mysql://localhost:3306/spring?characterEncoding=UTF-8&serverTimezone=UTC User name : choi Password :

실행시 driver 이름 변경 필요

com.mysql.cj.jdbc.Driver 위 링크랑 동일

Sun-Choi commented 5 years ago

password 분실

서버 다시 띄우기 https://moman1995.tistory.com/62

$ mysqld.exe -u root --skip-grant-tables

$ mysql.exe -u root

비밀번호가 틀린줄알았더니.. cmd에서 이슈가 있던거 mysql command라인에선 정상적으로 실행됨 https://m.blog.naver.com/PostView.nhn?blogId=doublebee1&logNo=221145290011&proxyReferer=https%3A%2F%2Fwww.google.com%2F

mysql.exe -u choi -p spring
Enter password: *********
Welcome to the MySQL monitor.  Commands end with ; or \g.