mysql查詢表和欄位的註釋
阿新 • • 發佈:2018-11-17
1,新建表以及新增表和欄位的註釋.
create table t_user(
ID INT(19) primary key auto_increment comment '主鍵',
NAME VARCHAR(300) comment '姓名',
CREATE_TIME date comment '建立時間'
)comment = '使用者資訊表';
alter table t_user comment = '修改後的表註釋資訊(使用者資訊表)';
alter table t_user modify column id int comment '主鍵ID';
--注意:欄位名和欄位型別照寫就行
use information_schema;
select * from TABLES where TABLE_SCHEMA='my_db';
--查詢某一張表的
use information_schema;
select * from TABLES where TABLE_SCHEMA='my_db' and TABLE_NAME= 'auth_user';
use information_schema;
select * from information_schema.columns where table_schema ='my_db' and table_name = 'auth_user';
show create table table_name;
use my_db;
show full columns from auth_user;