Last active
May 25, 2016 21:27
-
-
Save woodphil/00db5175d44ce8793b46819d30514caa to your computer and use it in GitHub Desktop.
Grab the table schema and columns of a mysql db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -h<hostname> -u<username> -p<password> >output.txt << EOF | |
SELECT table_name, column_name, column_type | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE table_schema='<db_name>' | |
ORDER BY table_name, ordinal_position; | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment