Query to show all tables and their collation

Parris Varney picture Parris Varney · Feb 9, 2011 · Viewed 35.3k times · Source

Is there a query that can be run in mysql that shows all tables and their default collation? Even better if there was on that could show all collations on all columns of all tables.

Answer

Joe Stefanelli picture Joe Stefanelli · Feb 9, 2011
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLLATION_NAME
    FROM INFORMATION_SCHEMA.COLUMNS