Skip to content

Instantly share code, notes, and snippets.

@thomasfr
Last active August 29, 2015 14:06
Show Gist options
  • Save thomasfr/d1e4fde76b2585380752 to your computer and use it in GitHub Desktop.
Save thomasfr/d1e4fde76b2585380752 to your computer and use it in GitHub Desktop.
Create Mysql user, password and grant rights on database
/** GRANT [type of permission] ON [database name].[table name] TO ‘[username]’@'localhost’ IDENTIFIED BY 'some_pass' WITH GRANT OPTION; **/
GRANT ALL PRIVILEGES ON DATABASE.* TO 'newuser'@'localhost' IDENTIFIED BY 'some_pass';
FLUSH PRIVILEGES;
/** BACKUP USER **/
GRANT SELECT,LOCK TABLES ON *.* TO 'backup'@'localhost' IDENTIFIED BY 'PASS';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment