Saturday, May 29, 2010

Create new user and privilege database

Below tutorial were the simplest and not-that-secure way to create a new user with database. For more restrictive and securer way please refer to MySQL Official Reference. And there were lots of tutorial on the web. just google it....

1. Create a new user -- domain='%' for allow remote connection

  • create create user 'username'@'domain' identified by 'some_pass'; 
  • insert into user values('domain','username',password('some_pass'),'Y','Y','Y','Y','Y'
    ,'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
2. create database dbname;
3. grant all privileges on dbname.* to 'username'@'domain';
4. flush privileges;

that's all! now Enjoy!!!

0 comments:

Post a Comment