Skip to content

Instantly share code, notes, and snippets.

@geekdada
Created June 16, 2014 08:58
Show Gist options
  • Save geekdada/52f8b31f8a8c26047a6b to your computer and use it in GitHub Desktop.
Save geekdada/52f8b31f8a8c26047a6b to your computer and use it in GitHub Desktop.
新建一个 DB 并授权
DROP DATABASE IF EXISTS `<db name>`;
CREATE DATABASE `<db name>`
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
USE 'mysql';
GRANT ALL PRIVILEGES ON <db name>.* TO '<username>'@'localhost' IDENTIFIED BY '<password>'
WITH GRANT OPTION;
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment