Debian is a great operating system and may be the most stable within Linux, but it has the disadvantage of not having updated packages. Because of this we gain a lot of stability but lose some novelty. In this article, you will learn how to install the latest version of MariaDB on Debian 9.
MariaDB: The son surpasses the father
After Oracle buys Sun microsystem, there was a huge concern about MySQL’s future. That’s why MariaDB emerges as a 100% compatible fork maintained by the community and the initial creators of MySQL.
The consequences have been positive, as MariaDB being 100% compatible with MySQL ensures that the Community spirit of MySQL is maintained. In addition, large Linux distributions such as Debian, Ubuntu Server or CentOS include it by default in their official repositories, which makes it available easily and simply.
Debian is stable but it has a cost
As I mentioned earlier, Debian is very stable but its packages are not the latest versions. The great advantage of this is that it makes Debian a very stable distribution but the user misses out on some of the new features corresponding to the packages.
For example, Debian 9 includes MariaDB 10.1 but the last version is 10.3.10.
Before we continue let me warn you that, if you have a server in production and you don’t really need the update, you better not do it. While it’s true that the steps I’m going to take are safe, something can always happen. So, be sure.
Install the latest version of MariaDB
MariaDB 10.3.10 is a minor version of the 10.3 series. Some of its main novelties are: bug fixes on InnoDB, corruption of InnoDB temporary tables is corrected and improvements in program performance. As well as to polish the sentences and to add better syntax to the same ones.
There is no easier way to install the latest stable version of MariaDB than by using the MariaDB repository. In addition to ease, it is quite safe to do it this way and thus you are always guaranteed to be prone to an update of the program.
First, upgrade the system.
:~$ su :~# apt update && apt upgrade
Doing this ensures that you have the latest security patches installed and have a more stable and reliable system.
Then, install some required packages
:~# install software-properties-common dirmngr
Next, you have to add the GPG key for the MariaDB repository.
:~# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
Now, add the repository.
Refresh the APT cache.
Then, install MariaDB packages.
:~# apt install mariadb-server
During installation, you will be asked if you want to define a root password. I chose yes, but you can do it later.
Once the installation is finished, you can access the MariaDB console. There you can run the commands and verify the installed version.
:~# mysql -u root -p
As you can see, the version installed is 10.3.10. In short, it is the last version available of MariaDB.
Conclusion
As you can see, the installation of the latest stable version of MariaDB is really simple and does not require many complications. However, it is important, to have at your disposal the new features
root@vultr:~# install software-properties-common dirmngr
install: cannot stat ‘software-properties-common’: No such file or directory
Oh. Before the installation, update the APT cache.
:~$ apt update