Migrating To MariaDB From MySQL in Ubuntu 15.04 With Root Bug Fix
MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. Being a fork of a leading open source software system, it is notable for being led by the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle. Contributors are required to share their copyright with the MariaDB Foundation [Wikipedia]
Migrating To MariaDB
Nothing new, and not that hard. It’s just as same as MySQL, so first we backup our existing databases and keep for later restoration
$ mysqldump -u root -p"your_password" --all-databases > ~/backup.sql
Stop and remove MySQL packages
$ sudo systemctl stop mysql $ sudo apt-get remove --purge mysql-server mysql-client mysql-common $ sudo rm -dr /etc/mysql
Install MariaDB
$ sudo apt-get update $ sudo apt-get install mariadb-server
Now here is where the changes comes in Ubuntu 15.04; you won’t be prompted to enter root password, even if you run
$ sudo mysql_secure_installation
will give you an authentication error
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
so after installation is done come to this step, login to mysql without password
$ mysql -u root
Next is are this commands
use mysql;
Execute this query
UPDATE <code>user</code> SET <code>plugin</code> = '' WHERE <code>User</code> = 'root';
Followed by
flush privileges;
Then exit
exit
You can now successfully run
$ sudo mysql_secure_installation
and set your password and other preferences.
You successfully have MariaDB running on your Ubuntu 15! 🙂
Restoring Backup
We ain’t done yet 😉 you have a backup waiting for you. This is gonna be easy, just login to MySQL as root
$ cd ~/ $ mysql -u root -p
After a succesful login, execute this
source backup.sql
After processing, we are good to go 🙂