How to Install MySQL 8.0 Community Edition on Ubuntu 18.04

As of February 2019, MySQL 8.0 was the newest version of MySQL. The new and exciting version has great improvements that you probably don’t want to miss.

Being an open source database, MySQL 8.0 has been re-engineered to offer most Windows SQL  functions as well as extended JSON functions. The InnoDB engine has been improved to offer a crash-safe environment and the performance schema has been enhanced.

Another great feature that ships with MySQL 8.0 is role management for organizing users better.

You can take advantage of all these great MySQL 8.0 features by installing it on your Virtual Private Server(VPS).

This guide takes you through the steps of setting up MySQL 8.0 community edition on your Ubuntu 18.04 server.

Prerequisites

Before you begin, make sure you have the following:

  1. A VPS account. Signup with Digital Ocean and get free $100 credit to test this article and other cloud services.
  2. A non-root user that can perform sudo tasks on your Ubuntu 18.04 server.

Step 1: Downloading MySQL 8.0 Repository

The default MySQL edition available on the Ubuntu software repository is not the newest version. So we are going to manually download the repository using wget command.

First,  cd to the tmp directory:

$ cd /tmp

Then, add the repository.

$ wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb

Next, we are going to use the dpkg command to install the repository on Ubuntu 18.04 server:

$ sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb

A dialog box will appear, choose OK and press Enter to continue.

Step 2: Installing MySQL 8.0 On Ubuntu 18.04 VPS

Next, update the package information index:

$ sudo apt-get update

To install MySQL, run the command below:

$ sudo apt-get install  mysql-server

Press Y and hit Enter when prompted to confirm the installation.

Towards the end of the installation, you will be prompted to enter the root user of your MySQL server; don’t confuse this with the root account of your VPS server.

 

Enter a strong password and hit Enter to continue. You will be prompted to repeat the password.

Select OK on the next dialog box and hit Enter

Then, select the right authentication plugin

The installation should be successfully installed.  You can confirm the MySQL version on your Ubuntu 18.04 server by running the command below:

$ mysql --version

Output:

mysql  Ver 8.0.15 for Linux on x86_64 (MySQL Community Server - GPL)

Step 3: Loggin to the MySQL 8.0 Server

To log in to the MySQL 8.0 server, run the command below:

$mysql -uroot -p

Enter the root password of the MySQL server and hit Enter to continue.

You will get a prompt similar to the one shown below:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.15 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

You can then start issuing commands on the MySQL command line interface e.g., show databases;

mysql> show databases;

Output:

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec

Conclusion

In this article, we have taken you through the steps of configuring MySQL 8.0 on your Ubuntu 18.04 VPS.

Sign up with Digital Ocean VPS today and get free $100 to deploy MySQL 8.0  on your next project to take advantage of improved features that you can’t find on other versions of MySQL.

Ads by Google

Leave a Reply

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