Jump to content

Recommended Posts

Hi all,

We are having problems with our mysql database. Random sites display the message "Unable to open file blahblah.MYI"

Now I know normally this can be sorted by repairing the table. This helps temporarily but the problem then appears somewhere else.

I created a php script to go through every table in every database and repair then optimize each table. I run that but we are still getting the random errors.

Does anybody have any ideas?

Thanks!
Link to comment
https://forums.phpfreaks.com/topic/3440-unable-to-find-file/
Share on other sites

Assuming this isn't a dedicated server you control, what does the host have to say?

Just a question that one of the MySQL gurus can answer. What error message/erratic behaviour would a database generate when the MySQL server is tragically overloaded?
Link to comment
https://forums.phpfreaks.com/topic/3440-unable-to-find-file/#findComment-11830
Share on other sites

That's not normal behavior even if you're overloaded.

These are the repairs I would attempt, in order:

Try dumping all the data into a backup file with mysqldump and then use it to create fresh tables with all the same data.

Try dropping the whole database and recreating it from backup.

Try reinstalling mysql.

Try another hard drive.

Try another server.
Link to comment
https://forums.phpfreaks.com/topic/3440-unable-to-find-file/#findComment-11860
Share on other sites

I'm not a proponent of giving up and re-installing everything -- mainly since it doesn't yield an explanation for the behaviour you describe.

Are these MyISAM tables or InnoDB tables? Is there nothing suspicious in the error log? What version of MySQL are you running (there are some known bugs regarding errno 24)?
Link to comment
https://forums.phpfreaks.com/topic/3440-unable-to-find-file/#findComment-11879
Share on other sites

Thanks for all your help folks... Im dumping the databases now...this will take a while as they are all pretty big.

I think I know how it has happened... My fault... We moved the databases from another server a while back and I was lazy and just copied the folders from the mysql data folder to the data folder on the new server. It worked but I think over time it has caused errors.

D'oh, I wont be as lazy in future and do things the proper way.

Ill let you know how I get on for future reference.
Link to comment
https://forums.phpfreaks.com/topic/3440-unable-to-find-file/#findComment-12394
Share on other sites

I suspected that you'd done something like that, that's why I recommended the dump & restore. Theoretically you should be able to copy the files, but there are several known issues when you do it between different versions, especially between 4 and 5. The bigger the version jump, the more likely to have problems.
Link to comment
https://forums.phpfreaks.com/topic/3440-unable-to-find-file/#findComment-12406
Share on other sites

They were the same mysql versions.

Anyway, I dumped the DB, removed MySQL and reinstalled everything. This hasnt helped.

I noticed when restoring the data that a few of the databases have invalid column names such as "fulltext" "date" etc etc. They errored out when I was trying to restore them. Could these be the cause of the problem?

Thanks!
Link to comment
https://forums.phpfreaks.com/topic/3440-unable-to-find-file/#findComment-12468
Share on other sites

Going back to an earlier post -- you said Error 24. That's mysql complaining about "too many open files". This sounds like there aren't enough file descriptors. I suggest you following the directions in [a href=\"http://dev.mysql.com/doc/refman/5.0/en/not-enough-file-handles.html\" target=\"_blank\"]this relevant refman page[/a] and take it from there. These are easy things to try and change, so go for it, and report back.
Link to comment
https://forums.phpfreaks.com/topic/3440-unable-to-find-file/#findComment-13648
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.