Installing MySQL Latest Versions on Ubuntu 17.04

In some cases newer features are only available in the most up to date version of MySQL. If you need there features installed with MySQL, you may have to install the latest version.

This brief tutorial shows students and new users how to easily add MySQL database repository in order to install the most up-to-date version. By default, MySQL packages are available in Ubuntu repositories.

However, it won’t be the most recent. If you need the most recent version, continue below to learn how to do it.

Step 1: Add MySQL Repository on Ubuntu

Adding MySQL repository will allow Ubuntu to access the most recent version of MySQL. Before you can add the repository, you must download a deb packages maintained by MySQL developers.

The package for Ubuntu can be downloaded from the link below:


Visit the download page and download the package. Or you can take notes of the current version of the package and run the commands below to download it, replacing version number with the most current.

cd /tmp/ && wget

Step 2: Installing the Repository

After downloading the repository package, run the commands below to install it.

sudo dpkg -i mysql-apt-config_0.8.3-1_all.deb

During the installation, you’ll be presented with a configuration screen to choose which version of MySQL to install, as well as the option to install its repositories. The default option will add a repository for the default stable version of MySQL.

This is the option we want.. so select the default. Scroll down the list and click Ok to install the repository.

mysql latest on ubuntu

After the repository is added, all you have to do is update and install MySQL.

Step 3: Installing MySQL

Now that the repository is added, run the commands below to install MysQL.

sudo apt-get update
sudo apt-get install mysql-server mysql-client

Doing the above will install MySQL from the repository with the latest packages for it.

After installing, you may want to run the commands below to secure MySQL.

sudo mysql_secure_installation

This will prompt you for the current root password you created when installing the software. You can follow the guide below to complete the setup.

Enter password for user root: ENTER ROOT PASSWORD
Press y|Y for Yes, any other key for No: n
Change the password for root ? n
Remove anonymous users? y
Disallow root login remotely? y
Remove test database and access to it? y
Reload privilege tables now? y

After that, you’re all done. This is how one installs MySQL latest versions on Ubuntu

You may also like the post below:


  1. Tried these instructions — got “you have unmet dependencies” on mysql-client and mysql-server. Attempting to troubleshoot now.

  2. Alfredo Del Campo

    thank you, my friend

  3. Thank you, very much!

  4. You might want to run ‘apt –fix-broken install’ to correct these.
    The following packages have unmet dependencies:
    mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
    mysql-testsuite-5.7 : Depends: mysql-server-5.7 (= 5.7.22-0ubuntu0.17.10.1) but it is not going to be installed
    E: Unmet dependencies. Try ‘apt –fix-broken install’ with no packages (or specify a solution)

    I am having this error installing and uninstalling mysql

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.