mysql show 명령어 db정보 확인
mysql 에서 DB정보들 확인하는 법
1) TABLES
- show tables from dbname like '%ABC' => 테이블 리스트
- show create table TABLE_NAME; => DDL 확인
- show columns from TABLE_NAME; == desc TABLE_NAME
- show table status from dbname like '%ABC' => table info
* 참조제약조건
select constraint_name, table_name
from information_schema.referential_constraints
where constraint_schema='SCHEMA_NAME'
and referenced_table_name='TABLE_NAME';
2) USER
- select * from mysql.user => 유저리스트
- show grants for 'user'@'ip'; => 권한 확인
3) DB
- show variables like '%server%'
- select database(); => 현재접속 DB
- select user(); => 현재접속 user
- select version(); => 버전정보 == show variables like 'version'.
- show processlist => select * from performance_schema.processlist;
- show events => select * from information_schema.events;