How to Configure MySQL Database Server on Ubuntu 11.10

Share this Article :

MySQLIn this post, i will share with you on how to perform basic configuration on MySQL database server on Ubuntu 11.10 linux. As we know, MySQL Server is the world’s most popular open source database and the most demanding Web’s database especially for blogging and to run web applications. Assumed that MySQL database has been installed successfully :

Steps Configure MySQL Database Server on Ubuntu 11.10:

1. Change its bind address. This is for security purpose. Skip this step if the applications and MySQ are running on the same machine.

[email protected]:~$ vim /etc/mysql/my.cnf

Original bind address :

bind-address           = localhost

Change to something like this :

bind-address            = 192.168.1.0

2. Set mysql root password
Type the following to access the database :

[email protected]:~$ mysql -u root

At mysql console, type the following to set the password :

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password');

3. Show user info on the database name’s mysql :

mysql> select user,host,password from mysql.user;
+------------------+-----------------------+-------------------------------------------+
| user             | host                  | password                                  |
+------------------+-----------------------+-------------------------------------------+
| root             | localhost             | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | ehowstuff.example.com | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | 127.0.0.1             | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| debian-sys-maint | localhost             | *0D767A6F1808D25DDAFB4AE43C9BA83063C89ED5 |
+------------------+-----------------------+-------------------------------------------+
4 rows in set (0.00 sec)

Alternatively, you can run this :

mysql> select user,host,password from user;
+------------------+-----------------------+-------------------------------------------+
| user             | host                  | password                                  |
+------------------+-----------------------+-------------------------------------------+
| root             | localhost             | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | ehowstuff.example.com | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| root             | 127.0.0.1             | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| debian-sys-maint | localhost             | *0D767A6F1808D25DDAFB4AE43C9BA83063C89ED5 |
+------------------+-----------------------+-------------------------------------------+
4 rows in set (0.00 sec)

Leave a Reply