我正在使用 SYS.ALL_OBJECTS、SYS.FOREIGN_KEYS 等系统目录视图来获取有关我在 MS SQL 2005 中的数据库结构的信息。
MySQL (v. 5) 服务器是否有等效的功能/视图?
我正在使用 SYS.ALL_OBJECTS、SYS.FOREIGN_KEYS 等系统目录视图来获取有关我在 MS SQL 2005 中的数据库结构的信息。
MySQL (v. 5) 服务器是否有等效的功能/视图?
对于模式(所有对象);
SELECT * FROM information_schema.SCHEMATA S;
也适用于约束和外键;
SELECT * FROM information_schema.TABLE_CONSTRAINTS T;
对于其他一切,请检查此查询;
SELECT * FROM information_schema.CHARACTER_SETS C;
SELECT * FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY C;
SELECT * FROM information_schema.COLLATIONS C;
SELECT * FROM information_schema.COLUMN_PRIVILEGES C;
SELECT * FROM information_schema.`COLUMNS` C;
SELECT * FROM information_schema.KEY_COLUMN_USAGE K;
SELECT * FROM information_schema.PROFILING P;
SELECT * FROM information_schema.ROUTINES R;
SELECT * FROM information_schema.SCHEMA_PRIVILEGES S;
SELECT * FROM information_schema.STATISTICS S;
SELECT * FROM information_schema.TABLE_PRIVILEGES T;
SELECT * FROM information_schema.`TABLES` T;
SELECT * FROM information_schema.TRIGGERS T;
SELECT * FROM information_schema.USER_PRIVILEGES U;
SELECT * FROM information_schema.VIEWS V;