Skip to content

Instantly share code, notes, and snippets.

@fedir
Last active April 21, 2017 16:20
Show Gist options
  • Save fedir/1356218 to your computer and use it in GitHub Desktop.
Save fedir/1356218 to your computer and use it in GitHub Desktop.
New database and it's user creation
#!/bin/bash
mysql -e "CREATE DATABASE \`$1\` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql -e "GRANT ALL PRIVILEGES ON \`$1\`.* TO '$2'@'localhost' IDENTIFIED BY '$3' WITH GRANT OPTION;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment