Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. ** Create a new user and provide permissions to one database
  2.  
  3. CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'new_password';
  4. GRANT ALL ON my_db.* TO 'new_user'@'localhost';
  5. FLUSH PRIVILEGES;
  6.  
  7. << or >>
  8.  
  9. GRANT ALL PRIVILEGES ON my_db.* To 'new_user'@'localhost' IDENTIFIED BY 'password';
  10. FLUSH PRIVILEGES;
  11.  
  12.  
  13. 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