Last active
July 23, 2019 15:51
-
-
Save bhubr/1abd13a8ae1280ed7272b30b74971ca1 to your computer and use it in GitHub Desktop.
Bash script: create MySQL database + user + grant privileges
This file contains hidden or 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 | |
mysql -uroot -p -e "create database if not exists $1 character set utf8 collate utf8_general_ci; create user if not exists $2@localhost identified by \"$3\"; grant all privileges on $1.* to $2@localhost; flush privileges;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment