Last active
August 7, 2019 11:39
-
-
Save fabiotatsuo/1824d1d3926581fef7ec8538a65c003e to your computer and use it in GitHub Desktop.
Mysql user commands
This file contains 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
List all users | |
SELECT user, host FROM mysql.user; | |
Delete user | |
DROP USER 'user'@'host'; | |
Create user | |
CREATE USER 'username'@'host' IDENTIFIED WITH mysql_native_password BY 'psswd'; | |
Grant privileges on db | |
GRANT ALL ON dbname.* TO 'username'@'host'; | |
Show grants | |
SHOW GRANTS for 'username'@'host'; | |
Session | |
SHOW PROCESSLIST | |
Kill session | |
Kill id | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment