Last active
March 4, 2019 21:41
-
-
Save stefanopulze/eb8a3b5069df5e7ecab6a0fb1d2e6b06 to your computer and use it in GitHub Desktop.
Useful mysql commands
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
| # connect | |
| mysql -u root -p | |
| # List databases | |
| show databases; | |
| # create database | |
| create database database-name; | |
| # Create user | |
| CREATE USER 'new-user'@'localhost' IDENTIFIED BY 'password'; | |
| # Create user can be connected from everywhere | |
| CREATE USER 'new-user'@'%' IDENTIFIED BY 'password'; | |
| GRANT ALL PRIVILEGES ON database-name. * TO 'new-user'@'localhost'; | |
| FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment