Showing posts with label Ubuntu Server. Show all posts
Showing posts with label Ubuntu Server. Show all posts

Saturday, 25 August 2012

Creating A Database user On Ubuntu Server


LogIN your Ubuntu Server > Goto terminal

On a default settings, mysql root user do not need a password to authenticate from localhost.
In this case, ou can login as root on your mysql server using:

$ mysql -u root

If a password is required, use the extra switch -p:

$ mysql -u root -p Enter password:

Now that you are logged in, we create a database:

mysql> create database database_name;
Query OK, 1 row affected (0.00 sec)

We allow user USERNAME to connect to the server from localhost using the password userpassword:

mysql> grant usage on *.* to username@localhost identified by 'userpassword';
Query OK, 0 rows affected (0.00 sec)
And finally we grant all privileges on the sslbd database to this user:
mysql> grant all privileges on database_name.* to username@localhost;
Query OK, 0 rows affected (0.00 sec)

Check :
goto : http://server_IP/phpmyadmin
User : username
Password : userpassword