Last active
December 31, 2015 05:29
-
-
Save Walkeryr/7941061 to your computer and use it in GitHub Desktop.
MySQL main administration 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
-- Change password for user to specific database | |
-- Create database | |
create database mydb; | |
-- Select database | |
use mydb; | |
-- Create user | |
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; | |
-- Grant privileges to database | |
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'localhost'; | |
-- Change password | |
SET PASSWORD FOR 'tom'@'localhost' = PASSWORD('foobar'); | |
-- Update privileges | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment