a guest Dec 23rd, 2017 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #STEP 1 - CREATE DB
- #check if db exists first
- echo "Creating a database for $newdb"
- DBS=`mysql -u$dbuser -p$dbpass -Bse 'show databases'| egrep -v 'information_schema|mysql'`
- for db in $DBS; do
- if [ "$db" = "$newdb" ]
- echo "This database already exists : exiting now"
- mysqladmin -u$dbuser -p$dbpass create $newdb;
- echo "Database $newdb created"
RAW Paste Data