New Mysql Database (and user)
- Details
- Category: Newbies in Command
Alrighty, it's an easy one, but I keep going astray. So here's how to set up a new MySQL database and add a user while at it. All at the command line, of course.
$ mysql -u ''adminusername'' -p
mysql> CREATE DATABASE ''databasename'';
mysql> GRANT ALL PRIVILEGES ON ''databasename''.* TO "''username''"@"''hostname''" IDENTIFIED BY "''password''";
mysql> FLUSH PRIVILEGES;
mysql> EXIT