티스토리 뷰
MariaDB Database생성
MariaDB[(none)]> create database mysql;
Database 생성 확인
MariaDB[(none)]> show databases;
MariaDB 유저 생성
MariaDB[mysql]> create user 'username'@'localhost' identified by 'password'; [하늘색 글자 임의로 지정]
MariaDB[mysql]> create user username@'localhost' identified by 'password'; [하늘색 글자 임의로 지정]
MariaDB[mysql]> create user username@'localhost' identified by 'password'; [하늘색 글자 임의로 지정]
MariaDB[mysql]> create user username@'%' identified by 'password'; [하늘색 글자 임의로 지정]
localhost 로 지정하면 외부 접근 불가능 , % 혹은 특정 IP를 지정하여 외부접속 허용
MariaDB 유저 삭제
MariaDB[mysql]> drop user username
MariaDB 권한 부여
MariaDB[mysql]> grant all privileges on Database.Table to User@'localhost';
[ User 에게 DB의 해당 테이블에 대한 모든 권한 부여 ]
MariaDB[mysql]> flush privileges;
MariaDB[mysql]> grant select on Database.Table to User@'localhost';
[ User 에게 DB의 해당 테이블에 대한 select 권한을 부여 ]
MariaDB[mysql]> flush privileges;
FLUSH PRIVILEGES; 권한 변경 내용 적용
- 이 명령어를 입력하지 않으면 해당 변경 내용 적용되지 않으며
- 변경사항이 있는 User에 flush 를 하지않으면 해당 User 삭제 불가능
( ERROR 1396 (HY000): Operation DROP USER failed for 'user'@'localhost' 에러 발생 )
보유 권한 확인
MariaDB[mysql]> show grants for '유저명'@'접속위치';
MariaDB 권한 삭제
MariaDB[mysql]> revoke all privileges on Database.Table fromUser@'localhost';
[ User의 해당 권한 삭제 ]
MariaDB User List 확인
MariaDB[mysql]> select host,user,password from mysql.user;
or
MariaDB[mysql]> select host,user,password from mysql.user where user='username';
[찾고자 하는 user가 있는 경우]
MariaDB Table List 확인
MariaDB[mysql]> show tables;
[단, database에 접속 된 상태에서 = 현재 db : mysql ]
'Development > DB' 카테고리의 다른 글
[DB/mysql] MySQL(MariaDB) 데이터 타입 (0) | 2018.07.11 |
---|---|
[DB/mysql] mac에서 mariadb 설치 및 설정 (0) | 2018.07.09 |
- Total
- Today
- Yesterday
- spring boot org.springframework.beans.factory.BeanDefinitionStoreException
- Stack
- 스프링 부트 에러
- hash알고리즘
- mac mariadb 설치
- springframewor
- mariadb 데이터타입
- spring boot 시작 에러
- mac db설치
- 해시알고리즘
- mysql 세팅
- HTTP
- 400 error
- mysql 데이터 타입
- Data Structure
- mysql데이터
- hash algorithm
- 400 badgateway
- 자료구조
- org.springframework.beans.factory.BeanDefinitionStoreException
- mariadb데이터 타입
- mariadb
- mariadb설치
- 데크
- mysql데이터타입
- 알고리즘
- mac mariadb
- 큐
- 스택
- 스프링 부트 시작 에러
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |