Hello Sunil
Step by step Instructions to Install MySQL on Ubuntu

Step by step Instructions to Install MySQL on Ubuntu Linux

MySQL is the most popular open-source relational database management system (RDBMS). It is fast, easy to use, scalable, and an integral part of the popular LAMP stack.

MySQL is backed by Oracle and runs on almost all platforms such as Linux, Windows, Mac and many others. In this article, we will show you how to install and use MySQL on Ubuntu Linux. Let’s get to it!

Also Read: Step by step Instructions to Install MySQL on RedHat Linux

Outline of this post:

  • Install MySQL on Ubuntu Linux
  • Manage MySQL service on Ubuntu Linux
  • Secure MySQL server on Ubuntu Linux
  • How to work with MySQL server on Ubuntu Linux
  • Install MySQL Workbench on Ubuntu Linux
  • Remove MySQL from Ubuntu Linux

Install MySQL on Ubuntu Linux

To install MySQL on Ubuntu Linux follow the steps below:

Step 1: First of all, make sure your repositories are updated by entering the following command in terminal (Ctrl+Alt+T):

sudo apt-get update

Update local packages - Install MySQL on Ubuntu Linux

Step 2: Then install MySQL package with the following command:

sudo apt install mysql-server

Install MySQL via terminal - Install MySQL on Ubuntu Linux

The system might ask you the password for “sudo” user and also provide you with a “Y/n” option to continue the installation.

Enter “Y” and then hit enter; MySQL will then be installed on your system. The process may, however, take some time depending on your Internet speed.

How to manage MySQL service on Ubuntu Linux

After successful installation of MySQL, it’s time to start MySQL server. Here are the steps which you need to follow:

Step 1: Start MySQL service using the following command.

sudo systemctl start mysql.service

Start MySQL service - Install MySQL on Ubuntu Linux

Step 2: If you want to enable MySQL run at system startup then type the following command in your terminal.

sudo systemctl enable mysql.service

Enable MySQL run at system startup - Install MySQL on Ubuntu Linux

Step 3: Finally you can verify the status of MySQL server by using the following command.

sudo systemctl status mysql.service

Verify  status of MySQL server - Install MySQL on Ubuntu Linux

How to secure MySQL server on Ubuntu Linux

Whenever you install a fresh copy of MySQL, there are some default settings that you should change in order to enhance the security of your MySQL installation. This includes the removal of test users, test databases and permission for remote login by a root user.

Sunil Pradhan

Developer, Explorer, Learner. My hunger and curiosity drive me forward in directions I want to go.

Add comment

Stay Updated

Want to be notified when our article is published? Enter your email address below to be the first to know.

Sunil Pradhan

Developer, Explorer, Learner. My hunger and curiosity drive me forward in directions I want to go.