mysql指令

一、show processlist:查询数据库连接的状态

 

二、show slave status;

 

三、数据库连接的超时时间

show global variables like '%timeout%';

set global wait_timeout=10;
set global interactive_timeout=10;

 

四、查询表的信息。

## 获取数据库下的全部的表的名字。
SELECT table_name FROM information_schema.tables WHERE table_schema='ygzj' and table_type ='BASE TABLE';

## 获取指定数据库的指定表的 全部的列名以及对应的数据类型和默认值。
SELECT column_name, data_type, column_default FROM information_schema.columns WHERE table_schema= 'ygzj' AND table_name= 'player';


## 根据数据库的表名显示 CREATE TABLE 语句
show create table test_table;

## 具体左右不明,好像是可以显示表的信息:字段名、类型、是否可为空、索引类型、默认值、额外信息。
desc test_table;

posted @ 2013-12-05 08:37  宁静的天空  阅读(228)  评论(0编辑  收藏  举报