$ mysql -u root
If a password is required, use the extra switch -p:
$ mysql -u root -p
Enter password:
Enter password:
Now that you are logged in, we create a database:
mysql> create database drupaldb;
Query OK, 1 row affected (0.00 sec)
Query OK, 1 row affected (0.00 sec)
We allow user amarokuser to connect to the server from localhost using the password amarokpasswd:
mysql> grant usage on *.* to drupaluser@localhost identified by 'drupalpasswd';
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on drupaldb.* to drupaluser@localhost ;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
$ mysql -u drupaluser -p'drupalpasswd' drupaldb