Restoring / copying / moving database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry

    #1

    Restoring / copying / moving database

    I am trying to move a datbase from one machine to another. I have
    tried two different methods and neither are working.

    First I tried using :
    [color=blue][color=green]
    >> mysqldump dbName > backup_file.sql
    >> mysql dbName < backup_file.sql[/color][/color]

    as the manual outlines, but I have a number of foreign keys resulting
    in errno=150 because the second command above is trying to restore
    data which is supposed to be linked to data in other tables that don't
    exist until that table is reached.

    So then I tried :
    [color=blue][color=green]
    >> mysqldump --disable-keys dbName > backup_file.sql
    >> mysql dbName < backup_file.sql[/color][/color]

    But that did not work either. The most obvious choice at this point is
    to create a script to restore the tables in the proper order, but this
    seems kind of tedious and a maintenance headache if tables are added /
    changed in the future.

    Next, I tried to simply copy the entire folder for the database. This
    folder contains *.frm files only (we have created all InnoDB tables).
    I created the database first then copied the files over to the
    appropriate folder. When I try to look at the table using the MySQL
    Control Center I get the error "Error 1016 : Can't open file
    'filename.InnoD B' (errno : 1)"

    I even moved the entire mysql installation folder, but received the
    same error???

    Any help would be appreciated.
Working...