System views in MySQL
2 answers
For the scheme (All objects);
SELECT * FROM information_schema.SCHEMATA S;
Also for constraints and foreign keys;
SELECT * FROM information_schema.TABLE_CONSTRAINTS T;
For everything else, check these queries;
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;
+4
source to share
Hmm, I haven't looked into everything it contains, but there is a lot of information in information_schema . There is also a show command .
However, I don't see any command to list all foreign keys.
+1
source to share