Install MySQL on Ubuntu 16.04 [Just 1 Minute Tutorial]

Install MySQL on Ubuntu 16.04 [Just 1 Minute Tutorial]

MySQL is widely used by many programmers. You cant simply run a web application without MySQL (This statement is not for people who use alternatives).

MySQL is an Open Source Database Management system registered under general public license. The main thing is that MySQL is now owned by Oracle corporation who bought Java as well.

Previously MySQL is owned by a Swedish company. Let’s dive into the procedure.

You could have read the installation of MySQL on Ubuntu 16.04 server in install lamp stack on ubuntu 16.04 server guide.

But:

This article covers the MySQL installation process in much more detail.

There are only two steps to install MySQL on Ubuntu Server.

  • Update Package Index
  • Install MySQL from repository
  • Configure and secure MySQL

Requirements

Other than that, you should have the sudo non root user account and then firewall enabled.

We explained both of them in that article, so you need to worry, if you have followed that guide.

Install MySQL Ubuntu

To install MySQL, just update the ubuntu package index.

And then, install MySQL server from Ubuntu Package repository. Here comes the advantage of Ubuntu. The Open source operating system has many of the applications in its Repository.

You can install them by just executing one simple command. Some times, you wont find any applications. In that case, you have to download the PPA from the main website and add it to your server repository.

To install MySQL, just use the install mysql command.

During the installation process, you will be asked to enter a root password. Make sure to enter a strong password.

One more important thing is remembering the password. Many guys who have been to the ubuntu server or other linux system for the first time, got confused with the Ubuntu command line interface and MySQL command line.

When they see both of them in the same command prompt, they confuse and close the command prompt and open it again to access the server terminal.

For you guys, here is my small explanation. When you see MySQL in the prompt, then it means you are inside the server and inside MySQL.

Just type exit to come out of MySQL.

MySQL Configuration

You have to secure the MySQL as it is one of the main source for hacker to enter into your site.

Here, i will show you a basic command which will help you to run the MySQL server security checkup.

Just Press Y for all the questions and Only Enter No when MySQL asks you to change the root password which you have set during the installation process.

Once you install and secure the MySQL, now its time to test it.

You can always use Ubuntu’s one of the general command to check status of any application.

The status MySQL. service will return status of any application.

You should see the following output similar to this one.

MySQL will be mostly running. If not, just use the below command.

This command will start running the MySQL.

Also, you can connect to the MySQL from new session of command prompt or from your local machine.

The above command will let you login to the MySQL.

You should get the below output.

Thats all you have done with the installation of MySQL.

Conclusion

Most of the PHP developers rely on MySQL heavily. Or if you are on to the process of wordress installation, checkout our ubuntu wordpress installation guide.

If you have any questions, contact us or comment here below. We will try to solve the issue.

Make sure to subscribe for our upcoming tutorials to receive the notification first.

 

Leave a Reply

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