MySQL Create Database by Command Line

This step is only necessary if you don't already have a database set-up (e.g. by
your host). In the following examples, 'username' is an example MySQL user which
has the CREATE and GRANT privileges. Use the appropriate user name for your

First, you must create a new database for SeniorQuoter (here, 'databasename'
is the name of the new database):

mysqladmin -u username -p create databasename

MySQL will prompt for the 'username' database password and then create the
initial database files. Next you must login and set the access database rights:

mysql -u username -p

Again, you will be asked for the 'username' database password. At the MySQL
prompt, enter following command:

ON databasename.*
TO 'username'@'localhost' IDENTIFIED BY 'password';


'databasename' is the name of your database
'username@localhost' is the username of your MySQL account
'password' is the password required for that username

Note: Only give your database user these privileges for maximum security!

If successful, MySQL will reply with:

Query OK, 0 rows affected

To activate the new permissions, enter the following command: