How to Install MySQL on Ubuntu 18.04 Bionic Beaver

Install MySQL on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure MySQL on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

MySQL is the most popular open-source relational database management system. It supports both SQL and NoSQL, and has a pluggable storage engine architecture. Additionally, it also comes with multiple database connectors for different programming languages, allowing you to develop applications using any of the well known languages, and many other features.

Install MySQL on Ubuntu 18.04

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

Step 2. Installing MySQL on Ubuntu.

Install the MySQL package with the following command:

Once the installation is completed, the MySQL service will start automatically. To check whether the MySQL server is running, type:

Step 3. Securing MySQL.

You should now run mysql_secure_installation to configure security for your MySQL server:

Then enter yes/y to the following security questions:

As a test, you can log into the MySQL server and run the version command:

That’s all you need to do to install MySQL on Ubuntu 18.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.