The question on how to install it has already been answered, so I will answer the cons and pros of MySQL and MariaDB, and how to install either one.
How to install MySQL.
This has already been answered, but I might as well include it here.
You can install MySQL via the APT repository.
To install the repository:
wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb
To actually install MySQL server:
sudo apt update
sudo apt-get install mysql-server
To install MariaDB.
Install the APT repo, just like MySQL
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
Then actually install MariaDB:
sudo apt-get install mariadb-server mariadb-client mariadb-backup
Differences between MySQL and MariaDB.
According to this website:
“MariaDB has a significantly high number of new > features, which makes it better in terms of performance > and user-orientation than MySQL.”
Basically, MariaDB is a drop-in replacement for MySQL and here’s a table of all the differences:
MySQL |
MariaDB |
Released in 1995 |
Released in 2009 |
Not a drop-in replacement for MariaDB |
Drop-in replacement for MySQL |
Proprietary code is accessible in MySQL Enterprise. |
Proprietary code isn’t accessible. |
MySQL has 1600 forks. |
MariaDB has 868 forks. |
Server supports Windows, Linux, FreeBSD, Solaris, and OS X |
Supports the same as MySQL. |
Can handle large amounts of data without becoming unstable |
|
Cannot handle large amounts of data. |
|
In my opinion , you don’t have to take my opinion, but I think MariaDB is a better choice than MySQL.
Update: A user in the comments pointed out some flaws, their comment states:
Your general assumption on MariaDB makes sense in basic situations, but in cases where large data comes into play, like more than 500,000 to millions of rows of data, MariaDB shows it’s flaws. MySQL is far more stable and refined and works great! I have had to upgrade many servers from MariaDB to MySQL for this reason. And the main reason people use MariaDB is to avoid possible licensing issues that honestly almost never come into play.
I have not fact checked any of these claims, but am including them here in case.