1. connect to mysql server: MYSQL -u root -p1234 -h localhost;
  2. create user: USER CREATE ‘user_name’@’localhost’ IDENTIFIED BY ‘password’;
  3. set privileges to user : GRANT ALL PRIVILEGES ON user_database.* TO user_name@localhost;

More info here:

http://www.debuntu.org/how-to-create-a-mysql-database-and-set-privileges-to-a-user/

Advertisements