mysql 3

[Mac] mySQL root 비밀번호 초기화

mySQL설치한지 얼마나 되었다고...그새 비밀번호 잊어버려서 초기화하는 작업을 진행했습니다... 1. mySQL서버 중지 mysql.server stop 2. 루트 인증없이 mysql 서버 시작 mysql.server start --skip-grant-tables 3. 루트계정에 접근 후 비밀번호 null 로 변경하고 변경된 권한 설정 mysql -u root mysql> update mysql.user set authentication_string=null where user='root'; mysql> flush privileges 4. mySQL재시작 후 비밀번호 변경 mysql.server restart; mysql -u root; mysql> alter user 'root'@'localhost'..

Coding/Back - Node 2022.10.31

[DB] Database, db table 생성

지난번 포스팅에서는 mysql 을 설치했으니, 실제로 사용할 데이터베이스도 생성해 보았습니다. 1. 데이터베이스 생성 mysql> CREATE DATABASE driving_log; 사용할 데이터 베이스를 선택합니다. mysql> use [DB먕]; 2. 테이블 생성하기 mysql> create table drive_hist( hist_seq int not null auto_increment primary key, car_id int not null, start_time DATETIME, end_time DATETIME, distance varchar(20), user_id int, foreign key (car_id) references car_info(car_id) on delete set defau..

카테고리 없음 2022.10.23

[MAC] M1 MySQL 설치

개인용으로 운영해볼 DB를 설치해보았습니다. 설치하기 brew install mysql 혹은 dmg파일로 직접 설치 합니다 : https://dev.mysql.com/downloads/mysql/ 정상적으로 설치되었는지 확인! mysql -V 완료되었으면 서버를 켜줍니다. mysql.server start #성공하면 아래처럼 출력 Starting MySQL . SUCCESS! 기본 설정하기 mysql_secure_installation 다음과 같은 질문이 차례대로 나옵니다. 비밀번호 복잡도 검사 과정 (yes or no) 비밀번호 입력 & 확인 익명 사용자 삭제 (y) : mysql 에서 기본 설정으로 익명유저를 만드는데 제거여부 질문 원격 접속 허용하지 않을 것인가? (y) test DB 삭제 (n) ..