Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, A little while I had a server crash... I was happy I had backups. So, I took my backups out, reinstalled everything. POP back online in an hour. However, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429

    MySQL Messedup after backup restore..


    Hello,

    A little while I had a server crash... I was happy I had backups.

    So, I took my backups out, reinstalled everything. POP back online in an hour.
    However, it looks I overlooked something with MySQL...
    When I launch the script that does the SQL thing I get
    Code:
    DBD::mysql::str execute failed: Can't find file: './av/users.frm' (errno: 13) at line x
    So I thought, did I forget to copy the Databases -,-'
    I had a look in my /var/lib/mysql folder and guess whats there.. the file.

    So, what did I forget to copy? And maybe I can still recover it?

    Thanks

    Robin
    New Users, please read this..
    Google first, then ask..

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,497
    OK, I'm guessing that av is the name of your database and that you have a table called users.

    In MySQL each table is represented by three files

    tableName.frm holds the structure of the data
    tableName.MYD is the actual data
    tableName.MYI holds the indexes.

    These files should be in your mysqldatadir/databaseName directory.

    How did you do your backup?

    Also when you copied your data back, did you stop the MySQL Service first?
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  3. #3
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429
    Quote Originally Posted by elija View Post
    OK, I'm guessing that av is the name of your database and that you have a table called users.
    I Guess you guessed correctly

    Quote Originally Posted by elija View Post
    In MySQL each table is represented by three files

    tableName.frm holds the structure of the data
    tableName.MYD is the actual data
    tableName.MYI holds the indexes.

    These files should be in your mysqldatadir/databaseName directory.
    Dang, that explains enough, I only have the frm files..

    Quote Originally Posted by elija View Post
    How did you do your backup?
    Also when you copied your data back, did you stop the MySQL Service first?
    The Backup is done with a dd but the hard drive got damaged.

    I'll have a good look around and hope I can find my data back in older backups..

    Thanks ^^

    EDIT:
    During the Backup the HD Crashed. Backup lost.. This is annoying..
    I try to add them again, and I get the error already exists. So I had to do this:
    Code:
    DROP TABLE `av`.`***`;
    CREATE TABLE `av`.`***` (
      `***` VARCHAR(45) NOT NULL,
      `***` VARCHAR(45) NOT NULL,
      PRIMARY KEY (`***`)
    )
    ENGINE = InnoDB;
    DROP TABLE `av`.`users`;
    CREATE TABLE `av`.`users` (
      `***` VARCHAR(45) NOT NULL,
      `***` VARCHAR(45) NOT NULL,
      `***` VARCHAR(45) NOT NULL,
      PRIMARY KEY (`***`)
    )
    ENGINE = InnoDB;
    It crashes again, I really want to fix it.. Well I guess today its Google Digging day for me
    Last edited by RobinVossen; 10-26-2009 at 09:25 AM.
    New Users, please read this..
    Google first, then ask..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •