Skip to content

Instantly share code, notes, and snippets.

@ilovejs
Created March 30, 2020 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilovejs/34e28de5db73791df97e426a93f4a3e5 to your computer and use it in GitHub Desktop.
Save ilovejs/34e28de5db73791df97e426a93f4a3e5 to your computer and use it in GitHub Desktop.
CREATE USER 'newuser'@'%' IDENTIFIED BY 'user_password';
DROP user 'qor'@'localhost';
CREATE USER 'qor'@'%' IDENTIFIED BY 'qor';
CREATE DATABASE qor_test;
GRANT ALL ON qor_test.* TO 'qor'@'localhost';
GRANT ALL ON qor_test.* TO 'qor'@'%';
ALTER USER 'qor'@'localhost' IDENTIFIED BY 'qor';
FLUSH PRIVILEGES;
UPDATE mysql.user
SET authentication_string = PASSWORD('qor')
WHERE User = 'qor' AND Host = 'localhost';
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment