Skip to content

Instantly share code, notes, and snippets.

@deathcult
Created November 13, 2013 08:46
Show Gist options
  • Select an option

  • Save deathcult/7445762 to your computer and use it in GitHub Desktop.

Select an option

Save deathcult/7445762 to your computer and use it in GitHub Desktop.
#!/bin/sh
## Get Database Data Dictionary
DB=database
DSN="mysql -uuser -ppw -hhost --default-character-set=utf8 $DB"
i=0
for TABLE in `$DSN -e 'show tables'`;do
let "i++"
SQL="show full columns from "$TABLE
echo $i" - "$SQL":"
$DSN -e "$SQL"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment