How to Configure MySQL Database Server on Ubuntu 11.10

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.

ehowstuff@ehowstuff:~$ 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 :

ehowstuff@ehowstuff:~$ 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

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee