Hi Almalinux specialists and users.
In an attempt to upgrade my mariadb from 10.3 to 10.6 I fell in a locked position.
I followed a manual that told me to copy my /var/lib/mysql/ to a backup location, which I did. After I removed MariaDB-server and MariaDB-client from the system . I upgraded the repository on almalinux for mariadb 10.6 And i reinstalled by : sudo dnf install MariaDB-server MariaDB-client . It found 10.6 and after that installation seemed normal.
Now, I know there are much better mariadb dump database commands to do this kind of thing now. Just I found the right manuals too late.
I executed this as a dump:
sudo mysqldump -u root -p --all-databases > /path/all-database-backup.sql
I don’t know if this command do mysql and mariadb databases in one file.
Besides that file I have only a hard copy of my old 10.3 database folder.
When I start mariadb after installation, it runs, however, trying to copy back my old /var/lib/mysql/ back to the new installation’s path (/var/lib/mysql/), all hell broke loose.
Whatever I do or try the server will not start up.
I started by checking all the permissions and ownership of var/lib/mysql/
(after hard copying the backup back to /var/lib/mysql/ )
sudo chown -R mysql:mysql /var/lib/mysql
sudo chmod -R 0755 /var/lib/mysql
And I tried commands like :
sudo mysql_upgrade -u root -p
Attempts to start mariadb or use the upgrade command above all end up in this kind of error:
$ sudo mariadb-upgrade -u root -p
Enter password:
Reading datadir from the MariaDB server failed. Got the following error when executing the ‘mysql’ command line client
ERROR 2002 (HY000): Can’t connect to local server through socket ‘/var/lib/mysql/mysql.sock’ (111)
I tracked for some hours to resolve this issue and save my databases. No luck, all manuals refer to permission and ownership.
Searching on: Can’t connect to local server through socket ‘/var/lib/mysql/mysql.sock’ (111)
Give me advice to delete log files like:
sudo rm /var/lib/mysql/ib_logfile0
sudo rm /var/lib/mysql/ib_logfile1
which should solve the problem. Doesn’t work.
I think the database is corrupt. cause the new version of mariadb can’t cope with the older databases i have for 10.3 But since I can’t use the mariadb-upgrade command,
I am not able to convert the databases to 10.6 format. Correct me if I am wrong.
Does anybody how to resolve this situation? I can’t go back to 10.3 cause I need 10.6 for an new application that is depending on 10.6
So I was forced to upgrade it, where the problem started. 10.3 was running fine.
Thanks in advance for any tips…
Dirk.