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

[email protected]:/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
[email protected]:/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.

Falko Timme

About Falko Timme

Falko Timme is an experienced Linux administrator and founder of Timme Hosting, a leading nginx business hosting company in Germany. He is one of the most active authors on HowtoForge since 2005 and one of the core developers of ISPConfig since 2000. He has also contributed to the O'Reilly book "Linux System Administration".

Share this page:

Suggested articles

5 Comment(s)

Add comment

Comments

By: Pintor

Great, is works fine.

By: lokeshjain2008

Thanks man! this helped me today.

 

By: Anonymous

Great its worked for me

 

By: Luiz Henrique

Thanks, it solved my problem

By: fernando

thanks men!