Follow dba-ninja.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

dba-ninja.com Links

Dba_db2_button

Sqlserver_dba_button

How to fix Table doesn't exist in engine error for MariaDB Error 1932

24 July,2020 by Rambler

Question: When attempting a mysqldump on one of the databases on a MariaDB server with this command I received  the error message mysqldump: Got error: 1932: "Table 'schema1.myTable' doesn't exist in engine" when using LOCK TABLES  

mysqldump -u myun -p database_name  > /mariadb/backups/mydb1171117.sql

Description: Backup of [~myDB1~] MySQL database failed. The error message [~mysqldump: Couldn't execute 'show create table `my_code`': Table 'mydb1.my_code' doesn't exist in engine (1932) ~] is received during backup.
Source: myserver1, Process: MySqlBackupChil

How can I fix? In summary - some files were moved around and this has caused the issue

Answer:I've found this error message appears when files have been moved around incorrectly. 

Test 1 - Try a native MariaDB backup and see if the same error occurs

mysqldump -u myun -p database_name  > /mariadb/backups/mydb1171117.sql

mysqldump: Got error: 1932: "Table 'myschema.mytable' doesn't exist in engine" when using LOCK TABLES

Test 2 - check to see if table exists 

use db;

show tables;

Yes it appears in list .  The reason "show tables;" works is because mysqld will scan the database directory for .frm files only. As long as they exist, it sees a table definition.

Test 3 - Tried  --skip-lock-tables parameter

Try to use --skip-lock-tables parameter with mysqldump to skip lock tables, like in the example below:

mysqldump --skip-lock-tables -u myun -p database_name  > /mariadb/backups/mydb1171117.sql

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

Test 4 - Check permissions - it should be mysql both group and owner

grep datadir /etc/my.cnf

ls -la /my_data_dir/mysql/data

Test 5 - If problem persists - try a TABLE REPAIR

mysqlcheck --repair mydb -uroot -p

status : Operation failed
myschema.myTable
Error : Table 'myschema.myTable' doesn't exist in engine

 

The tests above are a range of tests to establish some basic checkouts. Mainly this error occurs when these situations exist

1) InnoDB tablespace was deleted and recreated but related  InnoDB table.frm files  from the db directory were not removed.Another option is .frm files were moved to a different database

2)Incorrect permissions and ownership on table's files in MySQL data directory - check Test 4 above

3) MariaDB table data is corrupted 

 

 

!


Author: Rambler (http://www.dba-ninja.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to fix Table doesn't exist in engine error for MariaDB Error 1932


dba-ninja.com