How to install and configure the latest MySQL Server on Ubuntu in easy way
MySQL is the most popular SQL database server. This tutorial will show you how to install MySQL server in Ubuntu with just few steps.
Okay, lets start
1. First open terminal and paste the following command.
apt-get install mysql-server mysql-client libmysqlclient12-dev
2. By default, MySQL only receive local connections / from localhost (127.0.0.1). Now we need to edit this setting so we can connect to our MySQL from anywhere. Edit the MySQL configuration file located in /etc/mysql/my.cnf. You can use your favorite editor to do this. I use gedit in this case.
sudo gedit /etc/mysql/my.cnf
3. Find the line bind-address = 127.0.0.1 and comment it out.
#bind-address = 127.0.0.1
4. Close and save the file. Now check your configuration using this command
netstat -tap
Output Looks like below
tcp 0 0 *:mysql *:* LISTEN 4997/mysqld
5. By default, MySQL comes without any root password. For more safety, you need to set one.
#mysqladmin -u root password your-new-password
#mysqladmin -h root@local-machine-name -u root -p password your-new-password
#/etc/init.d/mysql restart
Okay, that’s it enjoy.









