Tom*_*ens 2 mysql sql-server system-views
我正在使用系统目录视图(例如 SYS.ALL_ OBJECTS、SYS.FOREIGN_KEYS 等)来获取有关我在 MS SQL 2005 中的数据库结构的信息。
MySQL (v. 5) 服务器是否有等效的功能/视图?
对于模式(所有对象);
SELECT * FROM information_schema.SCHEMATA S;
Run Code Online (Sandbox Code Playgroud)
也适用于约束和外键;
SELECT * FROM information_schema.TABLE_CONSTRAINTS T;
Run Code Online (Sandbox Code Playgroud)
对于其他所有内容,请检查此查询;
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;
Run Code Online (Sandbox Code Playgroud)