1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

MySQL error: Can't open file: 'foo.ibd' (errno: 1)

Discussion in 'Plesk for Linux - 8.x and Older' started by rihad, Jan 7, 2008.

  1. rihad

    rihad Guest

    0
     
    Hi all,

    After our database FS /var crashed on Debian 3.1 we had to pull its directory from backups (the only backup we had), including /var/lib/mysql/*. Despite chowning/chmodding everything thereunder for access by user mysql and starting the server successfully, the logs are full of messages like:

    The said link no longer exists: http://www.innodb.com/ibman.html
    There are several tables, not only misc.

    How can I bring everything together? I hear the same thing happens when you simply stop the server, copy the directory containing ibdata1 somewhere else, and start the server. How to make it work again? Please somebody help, this is urgent...

    Thanks.
     
  2. rihad

    rihad Guest

    0
     
    Additionally, it's only the psa db that got hosed, clients' own db are ok.
     
  3. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    965
    Likes Received:
    32
    Location:
    Romania
    PSA DB is InnoDB the clients ones usually is MyISAM. Do you have backup? Best is to dump back from backup. If not, then the best is to start the database with the files what is in /var/lib/mysql/ ibdata1;ib_logfile0;ib_logfile1 - this files are need to be there to start normally the innodb (as far as I know). Hope this help.
     
  4. rihad

    rihad Guest

    0
     
    Thanks, but like I said, the directory structure is the only backup we have :( Files ibdata1;ib_logfile0;ib_logfile1 are all there chmodded to 660 owner mysql group mysql. I'm having a hard time understanding why innodb can't deal with the complete directory structure. Anyone?
    The "(error: 1)" part is suspicious, too: it probably means the server is denied access to something.
     
  5. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    965
    Likes Received:
    32
    Location:
    Romania
    Can't open is usually file is not there phisically. Can you check? Did you tried to repair? I am out from ideas.
     
  6. rihad

    rihad Guest

    0
     
    "File not there" would normally be errno 2 (ENOENT), but not 1 (EPERM), which is my case. And the whole /var/lib/mysql/* directory structure is there with proper permissions as far as I can see (owned by mysql:mysql, files chmodded to 660 and directories to 700).

    Sad, let's see if somebody else has already solved seen such situations.
     
  7. rihad

    rihad Guest

    0
     
    Anyone?....
     
  8. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    You cant backup IDB by copying file structures. They are transactional databases that are built using log files. So what you can do is drop and recreate the databases, perhaps copy over your old file system backups, and then you will have to dump the logs into the table. In order to back them up, you also have to do a point in time backup of the binary log file for IDB as well.

    We ran something like this:
    Code:
    mysqlbinlog -d database_name --to-last-log --force-read /path/to/Binary_Log> outfile.sql
    
    You can also pipe the ouput directly into mysqld if you prefer.

    I've ran into this on windows servers before when a mysql install was on a partition that ran out of space and the IDB databases all crashes becuase the binary_log couldnt be written to anymore which corrupted the tables.
     
Loading...