/ Published in: SQL
$ mysql -u ''adminusername'' -p
Expand |
Embed | Plain Text
mysql> CREATE DATABASE ''databasename''; mysql> GRANT ALL PRIVILEGES ON ''databasename''.* TO "''username''"@"''hostname''" IDENTIFIED BY "''password''"; mysql> FLUSH PRIVILEGES; mysql> EXIT
Comments
Subscribe to comments
You need to login to post a comment.

on Ubunutu 10, this would not work when i removed the 2 single quotes around database name, then it worked.
just replace the databasename with the actual name of the databse you want to create... and replace username with your real username... and replace hostname with the name of your ubuntu server, usually "localhost" will work as the name of the host... and replace password with the ubunutu password for the username you typed before...
so on ubuntu:
mysql> CREATE DATABASE databsename ; mysql> GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'hostname' IDENTIFIED BY 'password' ; mysql> FLUSH PRIVILEGES ; mysql> exit