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.  
LVL 3
jmsloanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.