행위

"Mysql 사용자"의 두 판 사이의 차이

DB CAFE

(사용자 추가)
 
1번째 줄: 1번째 줄:
 
= 사용자 추가 =
 
= 사용자 추가 =
 +
'따옴표' 사용
 
<source lang=sql>
 
<source lang=sql>
 
$ create user '사용자'@'localhost' identified by '비밀번호';
 
$ create user '사용자'@'localhost' identified by '비밀번호';
 
</source>
 
</source>
 +
 
= DB 권한 부여 =
 
= DB 권한 부여 =
 
<source lang=sql>
 
<source lang=sql>

2020년 5월 29일 (금) 23:19 기준 최신판

thumb_up 추천메뉴 바로가기


1 사용자 추가[편집]

'따옴표' 사용

$ create user '사용자'@'localhost' identified by '비밀번호';

2 DB 권한 부여[편집]

$ grant all privileges on *.* to '사용자'@'localhost';
$ grant all privileges on DB이름.* to '사용자'@'localhost';
  • .* : 모든 DB에 접근 가능

DB이름: DB이름 지정

3 사용자 계정 삭제[편집]

$ drop user '사용자'@'localhost';