https://www.mysql.com/downloads/
설치하면서 비밀번호 설정을 꼭 해준다.
MySQL Command Line Client 뿐만 아니라 cmd 환경에서도 사용하려면 환경변수를 설정해야한다.
시스템 속성 - 환경변수 - 시스템 변수 'Path' - 편집
mysql -uroot -p
CREATE DATABASE DB이름;
SHOW DATABASES;
외부에서 접근할 수 있도록 '아이디'@'%'로 유저를 생성한다.
create user '아이디'@'%' identified by '비밀번호';
create database mydb;
create table joinTable(
id integer primary key,
title text not null,
body text not null);
INSERT, SELECT, UPDATE, DELETE 등의 권한을 추가/삭제 명령 ▶ GRANT/REVOKE
모든권한을 부여한다.
grant all privileges on db이름.* to '아이디'@'%';
부여된 권한을 확인해본다.
show grants for '아이디'@'%';
drop user '아이디';
또는
delete from mysql.user where user='아이디';