Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ** Create a new user and provide permissions to one database
- CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'new_password';
- GRANT ALL ON my_db.* TO 'new_user'@'localhost';
- FLUSH PRIVILEGES;
- << or >>
- GRANT ALL PRIVILEGES ON my_db.* To 'new_user'@'localhost' IDENTIFIED BY 'password';
- FLUSH PRIVILEGES;
- using % instead of localhost would give user the privilege to access the db from anywhere.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement