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 https://dev.mysql.com/get/mysql-apt-config_0.8.3-1_all.deb
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.
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.
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: