Is there any statement that can describe all tables in a database?
Something like this:
describe * from myDB;
Please create the bash script like below and it will prompt you for details.
LINUX ONLY - BASH SCRIPT - describe-all-tables.sh
#!/bin/sh
echo ""
read -p 'MySQL db: ' DB
echo ""
read -p 'MySQL user: ' USER
echo ""
read -e -p 'MySQL host: ' -i "localhost" HOSTNAME
echo ""
read -s -p 'MySQL password: ' PASSWORD
echo ""
mysql -N -u${USER} ${DB} -p${PASSWORD} -h ${HOSTNAME} --execute="show tables" | while read table; do mysql -u${USER} -h ${HOSTNAME} ${DB} -p${PASSWORD} -v -t --execute="describe $table"; echo -e "\n"; done
USAGE - /bin/sh describe-all-tables.sh