daily pastebin goal


a guest Dec 23rd, 2017 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. dbuser=user
  2. dbpass=pass
  3. #STEP 1 - CREATE DB
  4. #check if db exists first
  5. echo "Creating a database for $newdb"
  6. DBS=`mysql -u$dbuser -p$dbpass -Bse 'show databases'| egrep -v 'information_schema|mysql'`
  7. for db in $DBS; do
  8. if [ "$db" = "$newdb" ]
  9. then
  10. echo "This database already exists : exiting now"
  11.     exit
  12.   fi
  13. done
  14. mysqladmin -u$dbuser -p$dbpass create $newdb;
  15. echo "Database $newdb created"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand