Thursday, March 25, 2010

Create User in MySQL

mysql> create user 'username' identified by 'password';

mysql> grant all privileges on 'dbname' to 'username'@localhost identified by 'password' with grant option;

mysql> grant select, insert, update, delete, create, drop
-> on db.'dbname'
-> to 'username'@localhost
-> identified by 'password';

No comments: