How to Install MariaDB 10.1 on Debian 8
MariaDB 10.1 is the latest stable release and some interesting new features it implemented are as follows:
- built-in galera cluster support which is a true multi-master replication solution
- Data on disk is encrypted.
- optimistic parallel replication
- InnoDB/XtraDB page compression and page compression for FusionIO
For the full list of new features, go to official knowledge base. The repository of Debian 8 only has MariaDB 10.0. So in this tutorial, I will show you how to install MariaDB 10.1 on Debian 8 step by step.
Install MariaDB 10.1 on Debian 8
First we will install the command line software sources manager named software-properties-common. It gives us the ability to use the add-apt-repository utility. The graphical counterpart is called software-properties-gtk. Now we only need the command line version.
sudo apt-get install -y software-properties-common
Then import MariaDB signing key with apt-key so apt can verify downloaded packages from MariaDB.
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
Now we can use add-apt-repository to add the repository. [arch=amd64,i386] specifies that we only need amd64 and i386 architecture.
sudo add-apt-repository 'deb [arch=amd64,i386] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/debian jessie main'
After that is done, update local package index and install mariadb-server.
sudo apt-get update;sudo apt-get install mariadb-server
During the installation phase, you will be asked to set a password for the MariaDB adminstrative root user. You need to type the new password twice.
After the installation is completed, MariaDB server will be automatcially started.
sudo systemctl status mariadb or sudo systemctl status mysqld
● mariadb.service - MariaDB database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: active (running) since Sat 2016-03-19 01:49:08 EDT; 1min 28s ago Main PID: 18104 (mysqld) Status: "Taking your SQL requests now..." CGroup: /system.slice/mariadb.service └─18104 /usr/sbin/mysqld
Check MariaDB version.
You can also see the version number when you login with mysql client.
mysql -u root -p
Finally, for security, we should run the post installation script.
This script allows us to remove anonymous user, disable root remote login and remove test database for maximal security.