Skip to content

Instantly share code, notes, and snippets.

@galvao
Last active December 25, 2015 16:09
Show Gist options
  • Save galvao/7003686 to your computer and use it in GitHub Desktop.
Save galvao/7003686 to your computer and use it in GitHub Desktop.
Querying all column information from all entities in a MySQL Database
SELECT
table_name,
column_name,
data_type,
character_maximum_length,
numeric_precision,
numeric_scale,
column_type,
column_key,
extra,
is_nullable
FROM
information_schema.columns
WHERE
table_schema='<database_name>'
ORDER BY
table_name,
ordinal_position;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment