Last active
October 2, 2020 23:23
-
-
Save rojenzaman/5c6a66598a6149b8a795943830e27a90 to your computer and use it in GitHub Desktop.
with mysql root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -lt 4 ]; then | |
echo "`basename $0` <mysql-root-passwd> <db user> <ip> <db password>"; | |
exit 1; | |
fi | |
mysql --user=root --password=$1 <<EOF | |
CREATE DATABASE wordpress; | |
CREATE USER '$2'@'$3' IDENTIFIED BY '$4'; | |
GRANT ALL PRIVILEGES ON wordpress.* TO '$2'@'$3'; | |
exit | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment