Skip to content

Instantly share code, notes, and snippets.

@fedir
Last active Apr 21, 2017
Embed
What would you like to do?
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