How to Install MySQL 8.0 on Ubuntu 18.04. MySQL is an open source database management system used to store and retrieve data for a wide variety of popular applications.

To use the most new features of MySQL it is necessary to install the latest version of MySQL. In this guide you are going to learn how to install MySQL 8.0 on your Ubuntu 18.04.

Add MySQL Software Repository

The MySQL developers maintains the APT repository which provides a simple and convenient way to install and update MySQL products with the latest software packages using Apt.

To get the latest release go to MySQL downloads page and click the download button at the bottom right. In the Begin your Download page right click on the No thanks, just start my download and copy the link address.

Go to your server and download the file using the link you have copied.

cd /tmp
sudo curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb

Now a .deb software package will get downloaded to your server.

Use the dpkg command to install the package.

sudo dpkg -i mysql-apt-config*

You will prompted to choose the version, you can move to OK menu and hit Enter

sudo apt update

Now the MySQL repository is added and you can delete the downloaded file.

sudo rm mysql-apt-config*

Install MySQL 8.0

Once the package is added and the cache is refreshed you can install MySQL Server.

sudo apt install mysql-server

You can provide a secure password for your root. Next you need to configure the authentication plugin. Use the default Use Strong Password Encryption and hit Enter.

Wait for the installation to complete.

Once the installation is complete you can view the status of the MySQL server using the following command.

sudo systemctl status mysql
Output
 ● mysql.service - MySQL Community Server
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
    Active: active (running) since Thu 2019-06-25 17:46:42 UTC; 13s ago
      Docs: man:mysqld(8)
            http://dev.mysql.com/doc/refman/en/using-systemd.html
  Main PID: 7918 (mysqld)
    Status: "SERVER_OPERATING"
     Tasks: 37 (limit: 1152)
    CGroup: /system.slice/mysql.service
            └─7918 /usr/sbin/mysqld

Securing MySQL

Once the installation is completed it is necessary to secure the MySQL installation.

mysql_secure_installation
  • Enable the validate password plugin
  • Update the root password if you need
  • Remove anonymous MySQL user
  • Remove test database
  • Reload privileges

Now your installation is secured.

Conclusion

Now you have learned how to install MySQL 8.0 on Ubuntu 18.04. Next you can proceed to create database and assign users.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Write A Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Where Writing Meets Entrepreneurship!

Get FREE Google Cloud Tutorials.
GET NOW
close-link
Please help us get 1000 likes in Facebook. Thank You!
LIKE NOW

Stay Connected!

Get latest tutorials on Google Cloud and Open Source topics
SUBSCRIBE
close-link