MySQL : Create a user with his own database
I do it all the time when i start a new project, create a user with the database based on the same name, where the new user got ALL privileges on the base.
Pretty usefull, but i forget the exact syntax every time, here is the code :
CREATE DATABASE db_name;
GRANT ALL PRIVILEGES ON db_name.* TO "username"@"localhost" IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
Written by Xavier COIFFARD
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#