반응형
Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- JPA
- RabbitMQ
- cassandra
- ChannelPipeline
- netflix oss
- spring cloud
- Airflow
- vue.js
- Hibernate
- Redis Sentinel
- QueryDSL
- weblogic 10
- spring boot redis
- WebLogic
- KAFKA
- Netty
- coalesce
- docker
- MySQL
- Spring Open Feign
- docker compose mysql
- redis
- mybatis
- Docker Compose
- docker-compose
- grafana
- jmeter
- Selenium
- argo cd
- spring boot
Archives
- Today
- Total
IT.FARMER
mysql 사용자 추가 DB 권한부여 본문
반응형
# User DB 확인
SELECT HOST,USER,PLUGIN,authentication_string FROM mysql.user;
# 로컬에서 접속 가능한 사용자 추가하기
create user '사용자'@'localhost' identified by '비밀번호';
#로컬 접속 DB 모든 권한 부여하기 (localhost)
# 모든 DB에 권한 부여
$ grant all privileges on *.* to '사용자'@'localhost';
# 특정 DB에 권한 부여
$ grant all privileges on `DB이름`.* to '사용자'@'localhost';
#원격지 접속 DB 모든 권한 부여하기 '%', '특정 아이피 ' (remote host)
$ grant all privileges on *.* to '사용자'@'%';
$ grant all privileges on `DB이름`.* to '사용자'@'%';
# 특정 사용자에게 타겟팅된 특정 권한만 부여 하기
grant select, insert, update on `{db_name}`.* to '{userId}'@'{IP Address}'
grant select, insert, update on test.* to user@'localhost'
# 사용자 계정 삭제
$ drop user '사용자'@'localhost';
# 비밀번호 변경
ALTER USER 'userId'@'192.168.xxx.xxx' IDENTIFIED BY 'password';
ALTER USER 'userId'@'%' IDENTIFIED BY 'password';
# 변경 내용 저장
flush privileges;
반응형
'DataBase > mysql' 카테고리의 다른 글
mysql data backup (dump) (0) | 2022.05.11 |
---|---|
mysql collate 변경 column , table (0) | 2020.11.30 |
cent os 7 mysql 8 설치 (0) | 2020.09.15 |
Mysql 이모지(이모티콘) 4byte 적용 (0) | 2019.05.08 |
JAVA Mysql 타입 매칭 (0) | 2018.08.06 |