0

[This is more of a How-To-Post]

Ubuntu upgrade process to 18.04 had a window asking me what I wanted to do with my MariaDB install -- install MariaDB in Debian, or keep my install (a working MariaDB 10.2 install.) I must have select to do a Debian install, something that made sense to me at the time. Unfortunately this jailed (moved) my 10.2 database to a new location /var/lib/mysql-10.2. And downgraded my MariaDB install to a MariaDB 10.1 in Debian in place. Unfortunately it was only after the fact that this upgrade process prompted me about the fact that I will have to do a dump/import to regain access to all my data. Not easy to do if all I got is a copy of the database file/folder structure in /var/lib/mysql-10.2.

Now my Server version (after Ubuntu 18.04 upgrade) is: 10.1.29-MariaDB-6 - Ubuntu 18.04

I ended up uninstalling 10.1 and everything related to it

sudo apt-get purge mysql-server* mariadb*
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
sudo rm -rf /var/log/mysql

reinstall MariaDB 10.2

sudo apt install mariadb-server-10.2

stop mysql server

sudo systemctl stop mysql

following these direction I copied the missing databases from /var/lib/mysql-10.2 back to /var/lib/mysql. ONLY the missing database folder and content. And replaced these files: ib_buffer_pool, ibdata1, ib_logfile0, and ib_logfile1 with the original files from /var/lib/mysql-10.2

reset permissions to folder and content

sudo chown -R mysql:mysql /var/lib/mysql 

All seemed to work as planed, but somehow I was not able to gain access to the data. What made it finally work is running this as root:

mysqlcheck --all-databases -p

If you are back up and running, make sure to remove innodb_force_recovery = 5

I hope this helps someone stuck in the same situation.

1 Answer 1

0

as stated above ... [This is more of a How-To-Post]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .