• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • Last Modified:

ERROR 1017: Can't find file: 'postdata_cashier.MYD' (errno: 2)

Every morning when I get into work, I try to do a query on one of my mysql table.  I get this message.

ERROR 1017: Can't find file: 'postdata_cashier.MYD' (errno: 2)

I wrote a script to query the table every hour and send me a count of the table, so I could find out what time the table went bad.  I get email up to 4:00 a.m.  Come to find out We back up our tables at 4:00 a.m.

I have taken the test script out of the cron and still the MYD and MYI files are missing from /var/lib/mysql/database/

The only file that remains is postdata_cashier.frm

Can someone explain and tell me how to fix this problem.  
0
jmsloan
Asked:
jmsloan
  • 2
  • 2
  • 2
2 Solutions
 
jmsloanAuthor Commented:
Our backup procedure is a simple tar command to all database files.  
0
 
steve918Commented:
have you tried running your backup script manually just to make sure it's not the culprit?
0
 
jmsloanAuthor Commented:
Working on that now.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
SqueebeeCommented:
Sounds like your script is moving files out, not just copying. Before the TAR operation are you locking the tables? flushing them to disk?

You should do this:

1) Execute FLUSH TABLES WITH READ LOCK;
2) Copy the table files to a temp dir
3) Execute UNLOCK TABLES;
4) tar the temp dir
0
 
steve918Commented:
jmsloan,
Instead of flushing/locking the tables you can also just shut dow and restart mysql while your backing up your files.
0
 
SqueebeeCommented:
Absolutely, just depends on if you want users able to read tables during the backup. If you can shut down it is always a good idea.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now