Thursday, May 28, 2009

Creating a mysql user and granting privileges

//standard way of creating a user

CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';


//Creating a user and granting privileges:

GRANT ALL PRIVILEGES ON table.* TO 'user'@'localhost' identified by 'password'

//Show privileges for a user:

show grants for 'user'@'localhost'

No comments: