mariadb

Upgrading MariaDB from 10.0 to 10.1 to 10.2 on Ubuntu 16.04 / 17.10

Prepare MariaDB for Upgrade

To prepare MariaDB for Upgrade, logon to the database server as root with the root password and run the commands below

sudo mysql -u root -p

Then run the commands below to set innodb_fast_shutdown to 0

mysql> SET GLOBAL innodb_fast_shutdown = 0;

Backup Your Databases

It’s always important to backup your databases before attempting to upgrade
To back up, run the commands below against each database you wish to backup…

sudo mysqldump -u root -p database_name > backup_database.sql

Replace database_name with the actual database you wish to backup… Do that on all your databases…

Uninstall MariaDB 10.0 or 10.1

First, stop the database and uninstall…

On Ubuntu 16.04, run the commands below…

sudo systemctl stop mysql.service

On Ubuntu 17.10 and up, run the commands below:

sudo systemctl stop mariadb.service

Then run the commands below to uninstall MariaDB.

sudo apt remove mariadb-server

Install MariaDB Newer Versions

After uninstalling the older version, you can install MariaDB newer versions by using the repository below…

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8



For MariaDB 10.1, add the repository below:

sudo sh -c "echo 'deb [arch=amd64,i386] https://mirrors.evowise.com/mariadb/repo/10.1/ubuntu '$(lsb_release -cs)' main' > /etc/apt/sources.list.d/MariaDB-10.1.list"

For MariaDB 10.2, add the repository below:

sudo sh -c "echo 'deb [arch=amd64,i386] https://mirrors.evowise.com/mariadb/repo/10.2/ubuntu '$(lsb_release -cs)' main' > /etc/apt/sources.list.d/MariaDB-10.2.list"

After adding the package repositories, run the commands below to install the newer version of MariaDB based on the repository you added to your systems…..

sudo apt-get update

sudo apt-get install mariadb-server mariadb-client

Next, run the commands below to upgrade

sudo mysql_upgrade

 

Add root password to updated MySQL/Mariadb server

If you run into “MariaDB Plugin ‘unix_socket’ is not loaded Error”

MariaDB [(none)]>  install plugin unix_socket soname 'auth_socket';