Skip to content

Instantly share code, notes, and snippets.

@DevSecOpsGuy
Last active April 3, 2022 08:04
Show Gist options
  • Save DevSecOpsGuy/c0db568556fd7d4fd51ae2fe2f175040 to your computer and use it in GitHub Desktop.
Save DevSecOpsGuy/c0db568556fd7d4fd51ae2fe2f175040 to your computer and use it in GitHub Desktop.
mysql -u root -p
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
SELECT user();
SELECT user FROM mysql.user;
SELECT user,host FROM mysql.user;
SELECT host,user,authentication_string FROM mysql.user;
SHOW DATABASES;
CREATE DATABASE testDB;
GRANT ALL PRIVILEGES ON testDB . * TO 'newuser'@'localhost';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'newuser'@'localhost';
quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment