Skip to content

Instantly share code, notes, and snippets.

@hktonylee
Last active December 20, 2015 01:49
Show Gist options
  • Save hktonylee/6052361 to your computer and use it in GitHub Desktop.
Save hktonylee/6052361 to your computer and use it in GitHub Desktop.
MySQL Basic Operations
# create user
mysql -uroot -e "create user '$YOUR_NAME'@'localhost' identified by '$YOUR_PASS'"
# create database
mysql -uroot -e "create database $YOUR_DB_NAME character set utf8 collate utf8_general_ci;"
# grant privileges
mysql -uroot -e "grant all privileges on $YOUR_DB_NAME.* to '$YOUR_NAME'@'localhost' with grant option;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment