MySQL默认值和约束的查询方法

MySQL默认值和约束的查询方法插图亿华云

一、MySQL默认值相关查询

1. 列出 MySQL 数据库中的表默认值select table_schema as database_name,

table_name,

column_name,

column_default

from information_schema.columns

where column_default is not null

and table_schema not in (information_schema, sys,

performance_schema,mysql)

-- and table_schema = your database name

order by table_schema,

table_name,

ordinal_position;

说明:

database_name

THE END
Copyright © 2024 亿华云