Skip to content

Instantly share code, notes, and snippets.

@petercossey
Created May 7, 2012 10:06
Show Gist options
  • Save petercossey/2627019 to your computer and use it in GitHub Desktop.
Save petercossey/2627019 to your computer and use it in GitHub Desktop.
Setup a new database and database user
CREATE DATABASE db_name;
GRANT USAGE ON *.* TO 'db_user'@'hostname' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON db_name.* TO 'db_user'@'hostname';
# Shorter
create database db_name;
grant all on db_name.* to 'db_user' identified by 'password';
flush privileges;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment