天天看點

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;