2022 하계방학 SW 집중교육

[MySQL] 계정 및 권한 생성

딩딩크롱 2022. 8. 15. 16:43
728x90
show databases;
use mysql;
show tables;
select host, user from user;
desc user;

-- 사용자 생성
create user sku@localhost identified by "skupw";
create user sku@'%' identified by "skupw";

-- 데이터베이스 생성
create database skudb default char set utf8;

-- 권한 부여
grant all privileges on skudb.* to sku@localhost with grant option;
grant all privileges on skudb.* to sku@'%' with grant option;

-- 권한 삭제
revoke all on skudb.* from sku@localhost;
revoke all on skudb.* from sku@'%';

flush privileges;
728x90