Mysql user and database “always forget”

Posted: July 8, 2010 in Joomla

Add databases and user :p

I always forget how to do it…

mysql -u root -p

Enter password :

mysql>

mysql> create database akudb;

Query OK, 1 row affected (0.11 sec)

mysql> grant usage on *.* to akuuser@localhost identified by ‘akupassword’;

Query OK, 1 row affected (0.11 sec)

mysql> grant all privileges on akudb.* to akuuser@localhost;

Query OK, 1 row affected (0.11 sec)

mysql> flush privileges;

Query OK, 1 row affected (0.11 sec)

Finally test the user and databases.

mysql -u akuuser -p

Enter password :

mysq> show databases;

+——————–+
| Database           |
+——————–+
| akudb           |
+——————–+
2 rows in set (0.00 sec)

mysql> quit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s