Practical Web Programming

Tuesday, April 15, 2014

How to Create User in Mysql

Create the user that can access mysql via localhost:

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';


If you want the user to access the database from anywhere, then use this:


CREATE USER 'username'@'%' IDENTIFIED BY 'password';


Give the new user permission to access all databases and all its tables:

GRANT ALL PRIVILEGES ON * . * TO 'username'@'localhost';


Reload the privileges:

FLUSH PRIVILEGES;

0 comments:

Recent Post