#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    3
    Rep Power
    0

    Restoring InnoDB data


    I could really use some help here. I have the contents of a database from a server that died, and I need to restore it on our new server. I have the following files from the old mysql folder:

    ib_arch_log_000000000
    ib_logfile0
    ib_logfile1
    ib_data1


    as well as the files in the sub mysql/ folder:

    columns_priv.MYD
    columns_priv.frm
    columns_priv.MYI
    db.MYI
    db.MYD
    db.frm
    func.MYI
    func.MYD
    func.frm
    host.MYI
    host.MYD
    host.frm
    tables_priv.MYD
    tables_priv.MYI
    tables_priv.frm
    user.MYD
    user.MYI
    user.frm


    I tried transferring the ib_ files to the new mysql folder, and nothing seems to break. However, when I transfer any of the .MYI,.MYD, or .frm files then mysql refuses to start up properly. The old db was MySQL 4, and the new one is MySQL 5 - is it possible to restore 4 data to 5?

    If anyone could give me tips on what exactly to do to get things working it would be much appreciated.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0
    Looks like you took the files from the MySQL folder for MySQL4 and trying to start under MySQL5.

    Have you tried to do a mysql_upgrade 1st?


    Originally Posted by fffggghhh9
    I could really use some help here. I have the contents of a database from a server that died, and I need to restore it on our new server. I have the following files from the old mysql folder:

    ib_arch_log_000000000
    ib_logfile0
    ib_logfile1
    ib_data1


    as well as the files in the sub mysql/ folder:

    columns_priv.MYD
    columns_priv.frm
    columns_priv.MYI
    db.MYI
    db.MYD
    db.frm
    func.MYI
    func.MYD
    func.frm
    host.MYI
    host.MYD
    host.frm
    tables_priv.MYD
    tables_priv.MYI
    tables_priv.frm
    user.MYD
    user.MYI
    user.frm


    I tried transferring the ib_ files to the new mysql folder, and nothing seems to break. However, when I transfer any of the .MYI,.MYD, or .frm files then mysql refuses to start up properly. The old db was MySQL 4, and the new one is MySQL 5 - is it possible to restore 4 data to 5?

    If anyone could give me tips on what exactly to do to get things working it would be much appreciated.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by anothermysqldba
    Looks like you took the files from the MySQL folder for MySQL4 and trying to start under MySQL5.

    Have you tried to do a mysql_upgrade 1st?
    It doesn't work because I can't connect to the db after I transfer those mysql4 files. I just get an error when I try to connect:

    mysqld from pid file /var/run/mysqld/mysqld.pid ended


    Or if I just use the mysql_upgrade command I get "can't connect to local MySQL server through socket...". When I move the data I need to recover to the mysql folder, running mysql doesn't work.

    In a nutshell, I really need to know how to recover MySQL 4 data when all I have are the files I listed above.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    828
    Rep Power
    275
    I would suggest installing wampserver and the mysql 4.1 add-on and use that to export your data out of the mysql4 format and import it into mysql5 and see if it works.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    3
    Rep Power
    0
    Sorry guys, I'm an idiot. It turns out I was using data from the wrong mysql folder. On our old server it was installed somewhere else, and it includes [database name] folders in addition to the ibdata files and /mysql contents. So this time all I did was copy the ibdata files and the [database name] folders and not the /mysql folder contents, started mysql, and it works! I am able to grab the data just fine. Thanks for your help.

IMN logo majestic logo threadwatch logo seochat tools logo