我正在使用系统目录视图,例如SYS.ALL_ OBJECTS,SYS.FOREIGN_KEYS等,以获取有关MS SQL 2005中的数据库结构的信息。
MySQL(v.5)服务器是否有相同的功能/视图?
答案 0 :(得分:4)
对于架构(所有对象);
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;
答案 1 :(得分:1)
嗯,我还没有研究它包含的所有内容,但information_schema中有大量的信息。还有show命令。
但是,我没有看到一个命令来显示那里的所有外键。