This article will show you how to solve the following problem:

Error: MySQL - mysqldump: Got error: 1016: Can't open file: './exampledb/xxx.frm' (errno: 24) when using LOCK TABLES

This issue can happen when you try to create a MySQL database dump with the mysqldump command on Linux:

mysqldump -u root -pmysecretpassword --opt exampledb > exampledb.sql
root@server11:/tmp/mysql# mysqldump -u root -pmysecretpassword --opt exampledb > exampledb.sql
mysqldump: Got error: 1016: Can't open file: './exampledb/xxx.frm' (errno: 24) when using LOCK TABLES
root@server1:/tmp/mysql#

 

Solution for the mysqldum error

Add the option --lock-tables=false to the mysqldump command as shown below:

mysqldump -u root -pmysecretpassword --opt exampledb --lock-tables=false > exampledb.sql

This will fix the issue.

Share this page:

6 Comment(s)