Skip to content

Instantly share code, notes, and snippets.

@mixxorz
Last active March 13, 2016 04:38
Show Gist options
  • Save mixxorz/d3e99ebbb1b3d75a1bda to your computer and use it in GitHub Desktop.
Save mixxorz/d3e99ebbb1b3d75a1bda to your computer and use it in GitHub Desktop.
Creating new users and databases
# Postgres
psql -d postgres
CREATE USER user_name WITH PASSWORD 'password';
CREATE DATABASE database_name WITH OWNER user_name;
# MySQL
mysql -u root -p
CREATE DATABASE database_name;
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database_name.* TO 'newuser'@'localhost';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment