반응형
use mysql; or use information_schema; 실행후에는 매번 mysql./information_schema.안붙여도됨
- user account
- select * from mysql.user;
- 여기에 insert하는 것과 create user하는 것이 동일한 효과인듯 (create user하면 insert되어 있음)
- select * from mysql.user;
- 권한
- select * from mysql.db; schema/host/user별 권한확인가능
- 여기에 insert하는 것과 grant () on () to () 하는 것과는 다른듯ㅠ
- grant ()가 막혀있고 실행되지 않아 insert해보니 insert는 되지만 실제 권한은 못받음
- show grants (for current user) 명령어로 현재 user에게 허용된 grant문 전체를 볼수는 있음
- select * from information_schema.USER_PRIVILEGES;
- 위의 mysql.db와 동일한데 각 권한을 row별로 나열로해 놓은듯?
- select * from mysql.db; schema/host/user별 권한확인가능
- Table
- select * from infomation_schema.tables -> information_schema의 테이블뿐 아니라 모든 테이블 확인가능
- show tables; -> 현재 schema에 있는 테이블 목록만 보여줌
- Event
- event scheduler 활성화
- 활성화 확인: show variables like 'event%'; -> ON이면 활성화된것
- 활성화시키는법: set global event_scheduler=ON; / set @@global.event_scheduler=ON;
- read
- 생성된 event확인: select * from information_schema.EVENTS; / show EVENTS;
- e.g) select * from information_schema.events where event_name='EV_SP_IB_CONF_FILE'
- 등록된 event내용확인: show create event '이벤트명'; -> ?안됨
- 생성된 event확인: select * from information_schema.EVENTS; / show EVENTS;
- update
- alter event '이벤트명' on schedule every 1 month starts '2014-05-27 01:00:00';
- delete
- drop event '이벤트명';
- event scheduler 활성화
반응형
'db' 카테고리의 다른 글
oracle VS mysql (0) | 2020.02.26 |
---|---|
mysql query tip (0) | 2020.01.31 |
H2 DB 사용방법 (0) | 2019.10.30 |
daily check query (mysql & oracle) (0) | 2019.07.17 |
mySQL local 설치 및 실행 (on windows) (0) | 2019.02.27 |