Install the latest version of MySQL on Debian
Many times we want to install the latest version of MySQL in Debian and we realize that the stable version in the Debian repositories is far behind the stable version of MySQL itself. For this, MySQL gives us the option of installing the latest version from their own repositories. For Debian we can enter the following link and download the .apt.
https://dev.mysql.com/downloads/repo/apt/
If you're installing from the console, you must first copy the download link URL and bring it directly to your computer.
wget https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb
After this, you can proceed to install it with dpkg.
sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb
When installing MySQL in this way, it is possible that some required dependencies are not on your machine. If this is the case, you will get a message like the following:
root@debian-laravel:~# dpkg -i mysql-apt-config_0.8.14-1_all.deb
Selecting previously unselected package mysql-apt-config.
dpkg: regarding mysql-apt-config_0.8.14-1_all.deb containing mysql-apt-config, pre-dependency problem:
mysql-apt-config pre-depends on gnupg
gnupg is not installed.
dpkg: error processing archive mysql-apt-config_0.8.14-1_all.deb (--install):
pre-dependency problem - not installing mysql-apt-config
Errors were encountered while processing:
mysql-apt-config_0.8.14-1_all.deb
In this case, you must install such dependencies before proceeding with the installation of MySQL.
sudo apt-get install gnupg
After this, when running the dpkg successfully for the repositories, you must update the list of available packages. Notice that the downloaded file only adds the repositories to the system's list of available repositories.
sudo apt-get update
After this, you can install it like any other available package.
sudo apt-get install mysql-server