How to install MySQL 8 on Ubuntu 18.04?

Windows Articles

How to install Lighttpd on Ubuntu 20.04?

There are many web services in Unix but we always look for the one that best suits our needs. In this case,...

How to install Docker on Ubuntu 20.04 / Debian 10?

Docker is a fairly popular technology in today's sysadmin. It is logical to think because it means a complete change in the way images...

How to install Mantis Bug Tracker on Ubuntu 20.04?

Hi, folks. In this post, I will help you to install Mantis Bug Tracker on Ubuntu 20.04 If you...

How to install WordPress with Nginx on Ubuntu 20.04?

Hi, folks. In this post, we will help you install Wordpress with Nginx on Ubuntu 20.04. It's a lot easier than you...

Electron 9.0 available

News has arrived that many developers are going to love. And that is that Electron this great cross-platform application framework has released...
angeloma
angeloma
Senior Writer and partner

MySQL is one of those applauses that we can consider critical on a server. This is due to the fact that MySQL is a data manager and therefore, it can be assumed that critical applications use it. So, having MySQL updated with its latest versions becomes a necessary task to avoid surprises with our data. That’s why in this post, I will show you how to install MySQL 8 on Ubuntu 18.04.

MySQL 8

MySQL 8 is the latest large version of this powerful database manager. It comes with big improvements in the security section to compete with MariaDB which is a fork of this project. But not only that but at a more professional level has a better infrastructure to perform the replication process.

On the other hand, this version increases its performance in handling very large databases. It adds support to Unicode and other things. Of course, many bugs solved and security patches added.

As you can see, it is almost a necessity to have this version.

How to install MySQL 8 on Ubuntu 18.04

To install this version in our Ubuntu 18.04 system, we can have a dedicated MySQL repository. This is great news because we can do the installation from APT being quite safe and fast.

First, connect to your server using SSH or just open a terminal. Then, using wget, download the .DEB file that adds the repository. Then, install it.

:~$ wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
:~$ sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb

During the installation process, we will be shown a screen where we can configure which MySQL product we want. In our case, we want version 8 and it will be selected by default. So just scroll with the arrows on the keyboard and press enter on the OK option.

1.- Configure MySQL APT repository
1.- Configure MySQL APT repository

After that, just refresh APT and then install MySQL 8.

:~$ sudo apt update && sudo apt install mysql-server

During the installation process, you will be asked to define the password of the root user.

2.- Set the root password
2.- Set the root password

Then, we will be informed that the MySQL authentication methods have been improved and we will be asked if we want to activate this feature or use the old one that is compatible with MySQL 5.7.

3.- Configure MySQL 8
3.- Configure MySQL 8

So this is installed. However, we can do several more things.

To improve MySQL security, we can use the mysql_secure_installation script. There we will be asked a question to change MySQL settings.

:~$ sudo mysql_secure_installation

The questions are as follows:

Remove anonymous users?
Disallow root login remotely?
Remove test database and access to it?
Reload privilege tables now?

4.- Secure MySQL 8 installation
4.- Secure MySQL 8 installation

You can answer yes or no according to the case.

Now, you have to prove that MySQL 8 has been installed correctly. To do this, it is necessary to enter the MySQL console.

:~$ sudo mysql -u root -p
Enter Password:
Welcome to the MySQL Monitor

Then, let’s make a query of the created databases.

>show databases;

5.- Test MySQL installation
5.- Test MySQL installation

And that’s it.

Conclusion

In this post, you have learned to install MySQL 8 on Ubuntu 18.04. The process is greatly facilitated thanks to MySQL’s APT repository which makes it fast and secure. However, it is a process that requires knowledge of Linux and its terminal. In spite of this, it is very recommendable to do it because it improves the security and we will be able to count on a robust and current application.

Please share this post with your friends.

More articles

2 COMMENTS

  1. I don’t recommend vanilla MySQL, better take MariaDB. For that part the acquisition of the installer differs since they use a PPA.

    • You’re right. However, in many places, they still prefer MySQL over MariaDB. In addition, the brand “MySQL” is even better known than MariaDB.

      Thanks for comment.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install Lighttpd on Ubuntu 20.04?

There are many web services in Unix but we always look for the one that best suits our needs. In this case,...

How to install Docker on Ubuntu 20.04 / Debian 10?

Docker is a fairly popular technology in today's sysadmin. It is logical to think because it means a complete change in the way images...

How to install Mantis Bug Tracker on Ubuntu 20.04?

Hi, folks. In this post, I will help you to install Mantis Bug Tracker on Ubuntu 20.04 If you...

How to install WordPress with Nginx on Ubuntu 20.04?

Hi, folks. In this post, we will help you install Wordpress with Nginx on Ubuntu 20.04. It's a lot easier than you...

Electron 9.0 available

News has arrived that many developers are going to love. And that is that Electron this great cross-platform application framework has released...