命令行 | 作用 |
---|---|
show engines; | 查看存储引擎 |
select database(); | 查看当前数据库 |
show databases; | 查看数据库列表 |
show create database test; | 查看数据库test的建表语句 |
show tables; | 查看当前数据库下的表 |
show tables from test | 查看数据库test下的表 |
show create table xxx; | 查看表xxx的建表语句 |
select user(); | 查看当前用户 |
show engine innodb status\G | 查看InnoDB春初引擎的状态信息 |
show grants for ‘xxx’@‘xxx’ | 查看用户的权限信息 |
show create user ‘xxx’@‘xxx’ | 查看用户的属性信息 |
show columns from columns_priv like ‘%ab%’ | 查看含有ab字样的字段 |
show processlist; | 查看mysql线程列表 |
show status; | 查看mysql状态 |
show variables like ‘%xx%’; | 查看含有xx字样的参数 |
show variables where Variable_name in (‘slow_query_log’, ‘log_output’, ‘long_query_time’, ‘log_slow_admin_statements’, ‘slow_query_log_file’); | 查看某几个参数 |
show global status; | 查看mysql全局状态 |
select user,host from mysql.user; | 查看用户列表信息 |
select * from information_schema.routines | 查看存储过程列表 |