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.
sudo curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
.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
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
● 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
Main PID: 7918 (mysqld)
Tasks: 37 (limit: 1152)
Once the installation is completed it is necessary to secure the MySQL 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.
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.