Control PanelMySQLUbuntuVesta CP

How to Upgrade MySQL and Install MariaDB 10.2 on Ubuntu 18.04 LTS and 16.04 LTS

In this tutorial we’ll upgrade/install to Mariadb 10.2 on Ubuntu 18.04 LTS, 16.04 LTS and with vestacp when you install MySQL version 5.7 will be install on Ubuntu 16 and 18. This tutorial will also work with vestacp installed soon 18.04 will be supported by vestacp. MariaDB is designed as a drop-in replacement of MySQL with more features, new storage engines, fewer bugs, and better performance. MariaDB is developed by many of the original developers of MySQL who now work for the MariaDB Foundation and the MariaDB Corporation, and by many people in the community. To upgrade follow this simple steps to upgrade it to latest version.

Login as root and follow the commands one by one.

First Add mariadb apt repository :

For 18.04 LTS :

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp:// 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64] bionic main'

For 16.04 LTS :

apt-get install software-properties-common
apt-key adv --recv-keys --keyserver hkp:// 0xF1656F24C74CD1D8
add-apt-repository 'deb [arch=amd64,i386,ppc64el] xenial main'

To Upgrade :

This is only for the upgrade and follow this commands :-

Stop and remove MySQL server :

service mysql stop
apt remove mysql-client mysql-client-core  mysql-server mysql-server-core
apt remove mysql-server

Now we’ll Update/install

apt update
apt install mariadb-server

When the installer ask for the password just leave it blank it will ask to set the password 3-4 times for all time leave the password blank (imp when upgrading from mysql to mariadb only)

Well Mariadb is now installed and you just need to start mariadb server and upgrade the database :

service mysql start

Now upgrade the database :


To Install :

This is only for fresh installation don’t use it for the upgrade.

apt update
apt install mariadb-server

When it will ask you to enter root password please enter and remember the password, after successful installation start the mariadb server :

service mysql start

For VestaCP only extra config :

rm -rf /etc/mysql/my.cnf
ln -s /etc/mysql/mysql.cnf /etc/mysql/my.cnf

thats it you can login as root for the checks.

Sandeep B.

I'm a system admin and php developer and currently working as System Admin In CWP Control panel, expertise in Linux and Windows administration RHEL certified admin.

Related Articles


Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button