✏️/Database

[MySQL] 사용자 추가, 권한 설정, 삭제

sssbin 2021. 9. 13. 19:53

 

 

** mysql 접속하기 (맥북)

터미널 열고 → cd /usr/local/mysql/bin./mysql -u root -p

 

 

1. 사용자 추가

create user 'username'@'localhost' identified by 'password';

 

2. 사용자 권한 설정

grant all privileges on *.* to 'username'@'localhost';
flush privileges;
grant all privileges on db이름.table이름 to 'username'@'localhost';
flush privileges;

 

3. 사용자 삭제

drop user 'username'@'localhost';