MySQL基本命令 查看数据库、表的基本命令
来源:互联网 发布:hdc电视直播软件 编辑:程序博客网 时间:2024/05/21 13:54
1:show databases;
查看所有的数据库,等同于select schema_name from information_schema.schemata\G。\G 替换;,以纵向报表的形式输出结果,有利于阅读。
2. status 查看mysql数据库的运行状态
3. use 命令选择数据库 例如 use information_schema,当使用此命令后
select schema_name from information_schema.schemata\G,可以为
select schema_name from schemata\G
4. 查看数据库中的表
show tables
同样也可以在information_schema中查看,show命令是方便使用的简短模式。
select table_name from tables where table_schema='jblog';
5. 查看表结构
desc table_name;
6.查看表状态 show table status from db like 条件
可以查看engine数据库引擎,version,row、index等信息
7.小技巧,当多行命令输入,发现错误后,用\c结束。
-------------------------------------------------------------
另,查询数据库运行状态的基本命令:
#查询数据库连接
show full processlist;
show status like '%Max_used_connections%';
show status like '%Threads_connected%';#当前连接数
show status like '%table_lock%';#表锁定
show status like 'innodb_row_lock%';#行锁定
show status like '%qcache%'; #查询缓存情况
show variables like "%query_cache%";
SHOW STATUS LIKE 'Qcache%';
show variables like "%binlog%";
show status like 'Aborted_clients';#由于客户没有正确关闭连接已经死掉,已经放弃的连接数量
show variables like '%max_connections%';//查看最大连接数量
show variables like '%timeout%';#查看超时时间
show variables like 'log_%'; #查看日志是否启动
查看所有的数据库,等同于select schema_name from information_schema.schemata\G。\G 替换;,以纵向报表的形式输出结果,有利于阅读。
2. status 查看mysql数据库的运行状态
3. use 命令选择数据库 例如 use information_schema,当使用此命令后
select schema_name from information_schema.schemata\G,可以为
select schema_name from schemata\G
4. 查看数据库中的表
show tables
同样也可以在information_schema中查看,show命令是方便使用的简短模式。
select table_name from tables where table_schema='jblog';
5. 查看表结构
desc table_name;
6.查看表状态 show table status from db like 条件
可以查看engine数据库引擎,version,row、index等信息
7.小技巧,当多行命令输入,发现错误后,用\c结束。
-------------------------------------------------------------
另,查询数据库运行状态的基本命令:
#查询数据库连接
show full processlist;
show status like '%Max_used_connections%';
show status like '%Threads_connected%';#当前连接数
show status like '%table_lock%';#表锁定
show status like 'innodb_row_lock%';#行锁定
show status like '%qcache%'; #查询缓存情况
show variables like "%query_cache%";
SHOW STATUS LIKE 'Qcache%';
show variables like "%binlog%";
show status like 'Aborted_clients';#由于客户没有正确关闭连接已经死掉,已经放弃的连接数量
show variables like '%max_connections%';//查看最大连接数量
show variables like '%timeout%';#查看超时时间
show variables like 'log_%'; #查看日志是否启动
阅读全文
0 0
- MySQL基本命令 查看数据库、表的基本命令
- Mysql数据库的基本命令
- MySql数据库基本命令
- MySQL数据库基本命令
- 数据库MySQL的基本操作命令
- MySQL数据库的基本操作命令
- MySQL数据库的基本操作命令
- MySQL数据库的基本操作命令
- mysql数据库的基本操作命令
- MySQL的基本数据库操作命令
- MySQL学习日志 数据库的基本命令
- 数据库的基本命令
- mysql的基本命令
- mysql的基本命令
- MySQL的基本命令
- MySQL的基本命令
- MySQL的基本命令
- MySQL的基本命令
- Java多线程--概述-转自林炳文Evankaka
- 随机生成20个数,找出最中间的那个数
- 夕——做一首只能读不能念的小诗
- lintcode 直方图最大矩形覆盖与最大子矩阵
- table表格------一行隐藏和显示
- MySQL基本命令 查看数据库、表的基本命令
- [BZOJ]2744: [HEOI2012]朋友圈 二分图匹配
- C++ POD(Plain Old Data)类型
- Project Euler 6-10题
- 马哲法科的jQuery
- 平衡二叉树平衡法则
- 同步AD站点信息命令
- 在 Mac OS X 中启用和使用“root”用户(雪豹版)
- php删除字符串最后一位