Skip to content

Instantly share code, notes, and snippets.

@mul14
Created May 15, 2022 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mul14/8efd87d13deb1ef39e60a555d79efe50 to your computer and use it in GitHub Desktop.
Save mul14/8efd87d13deb1ef39e60a555d79efe50 to your computer and use it in GitHub Desktop.
MySQL: Create new user with native password
CREATE USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';
FLUSH PRIVILEGES;
-- Reference: https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment