Created
May 10, 2019 18:00
-
-
Save LukeWJensen/321467c437d36fff2f028adb682aa05c to your computer and use it in GitHub Desktop.
[Mysql Database and User Management] #mysql #database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--CREATE DATABASE | |
CREATE DATABASE db_name; | |
--SHOW USERS | |
SELECT User FROM mysql.user; | |
--DELETE USERS | |
DROP USER 'user_name'@'localhost'; | |
--CREATE USER | |
CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'password123'; | |
--GRANT PRIVILEGES | |
GRANT ALL ON bd.* TO 'db_user'@'localhost'; | |
--FLUSH PRIVILEGES | |
FLUSH PRIVILEGES; | |
--VERIFY USER AND PREV | |
SELECT User from mysql.user; | |
SHOW GRANTS FOR 'db_user'@'localhost'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment