SHARE
TWEET

Untitled

a guest Mar 20th, 2017 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /usr/bin/env bash
  2. PASS=`pwgen -s 40 1`
  3.  
  4. mysql -uroot <<MYSQL_SCRIPT
  5. CREATE DATABASE $1;
  6. CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
  7. GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
  8. FLUSH PRIVILEGES;
  9. MYSQL_SCRIPT
  10.  
  11. echo "MySQL user created."
  12. echo "Username:   $1"
  13. echo "Password:   $PASS"
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
 
Top