Create MySQL Dbase and user

January 26, 2006

Just adding this here so I wont have to search for it or ask anyone ever again.

create database db_name;
grant all privileges on db_name.* to ‘user’@'localhost’ identified by ‘password’;

  • http://fauxzen.com Shelby

    This also works

    mysql -u root -p
    mysql> create database DBNAME;
    mysql> grant all on DBNAME.* to DBUSER@localhost;
    mysql> set password for DBUSER@localhost=password(‘PASSWORD’);
    mysql> exit