0
点赞
收藏
分享

微信扫一扫

MySQL常用命令总结

1kesou 2022-01-20 阅读 87
命令行作用
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查看存储过程列表
举报

相关推荐

0 条评论