1

I had to redo my server (Debian 9) in Proxmox. I updated a package (libc6) and I broke the dependencies (I didn't snapshot it...). One of the affected daemons was MySQL / MariaDB, I could not make a backup from PhpMyAdmin because the daemon does not work and I could not connect to the database.

Now I have installed Debian 10, but I am having problems recovering the database from the other machine.

mysqldump: Couldn't execute 'show create table `xxx.yyy`': Table 'yyy' doesn't exist in engine (1932)

The following errors are prompted when I tried the following solutions:

root@debian:~# mysqldump -u root -p --all-databases > all_databases.sql
Enter password:
mysqldump: Got error: 1932: "Table 'mysql.gtid_slave_pos' doesn't exist in engine" when using LOCK TABLES
root@debian:~# mysqldump --skip-lock-tables -u root -p --all-databases > all_databases.sql
Enter password:
mysqldump: Couldn't execute 'show create table `gtid_slave_pos`': Table 'mysql.gtid_slave_pos' doesn't exist in engine (1932)

Source: https://support.plesk.com/hc/en-us/articles/213931725-Dump-of-the-MySQL-database-hosted-on-the-Plesk-server-fails-mysqldump-table-doesn-t-exist-when-using-LOCK-TABLES

root@debian:~# mysqlfrm --server=xxx:yyy@localhost:3306 test.frm --port=3310
WARNING: Using a password on the command line interface can be insecure.
# Source on localhost: ...
Usage: mysqlfrm --server=[user[:<pass>]@host[:<port>][:<socket>]|<login-path>[:<port>][:<socket>]] [path\tbl1.frm|db:tbl.frm]

mysqlfrm: error: Can't connect to MySQL server on 'localhost:3306' (111 Connection refused)

Source: https://dba.stackexchange.com/a/127813

MariaDB [(none)]> ALTER TABLE mysql.gtid_slave_pos DISCARD TABLESPACE;
ERROR 1932 (42S02): Table 'mysql.gtid_slave_pos' doesn't exist in engine

Source: https://stackoverflow.com/questions/51997127/restore-mysql-database-using-only-frm-and-ibd-files

I'll try to answer some related questions that somebody already asked me.

  • How did I get into this state?

I don't exactly know it but I think that I broke MySQL after I tried to restart several times mysqld/mariadb service while I tried several solutions downgrading libc6 or trying to make mariadb to run again.

  • What was the MySQL/MariaDB version in Debian 9?

mariadb Ver 15.1 Distrib 10.1.44-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

  • What is the version in Debian 10?

mariadb Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

  • Did I copy the entire datadir from one to another?

No, I didn't try that... But I didn't find anything useful on stackoverflow sites nor google. Maybe the following information I'll try to research this (I'll edit this question later), but it would be wonderful to see an answer related to this.

  • Did I run mysql_upgrade?

No, I didn't try that maybe by updating mariadb in Debian 9 could be a possible solution. But reviewing packages for Debian 9, I didn't found the mariadb 10.3 version for Debian 9 (the one that clib6 2.30-10 requires, I was on 2.14).

Can you take a mysqldump of other databases in the server (ie. not the mysql named one)?

Yes, I did backups for some databases but I couldn't backup all of them (only 3 or 4 from 10).

Is there any option left?

z3nth10n
  • 119
  • 1
  • 8

0 Answers0