Skip to content

Instantly share code, notes, and snippets.

@shanonvl
Created March 14, 2014 17:45
Show Gist options
  • Save shanonvl/9552916 to your computer and use it in GitHub Desktop.
Save shanonvl/9552916 to your computer and use it in GitHub Desktop.
MySQL: Create Database
CREATE DATABASE `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON `mydb`.* TO `username`@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
-- Alternatively, you can use ‘CREATE SCHEMA’ instead of ‘CREATE DATABASE’:
-- CREATE SCHEMA `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci;
-- GRANT ALL ON `mydb`.* TO `username`@localhost IDENTIFIED BY 'password';
-- FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment