Professional Web Applications Themes

transferring MySQL databases from one machine to another - MySQL

Hi I am trying to migrate a MySQL database from one machine to another but am not sure how to go about this. I physically copied the .frm files but that does not seem to work. Does anyone have any ideas how to do this? The database is not very large (I could actually recreate the database manually) but I want to know how this is done for future projects. Any help would be highly appreciated. Thanks....

  1. #1

    Default transferring MySQL databases from one machine to another

    Hi

    I am trying to migrate a MySQL database from one machine to another but am
    not sure how to go about this. I physically copied the .frm files but that
    does not seem to work. Does anyone have any ideas how to do this? The
    database is not very large (I could actually recreate the database manually)
    but I want to know how this is done for future projects. Any help would be
    highly appreciated. Thanks.



    Navodit Guest

  2. #2

    Default Re: transferring MySQL databases from one machine to another

    Navodit wrote: 
    My approach for MyISAM files between identical versions of MySQL is:

    First 'flush tables' using MySQL and make sure the system is quiescent -
    shutting down the server is a good idea.

    I usually copy the entire database directory but copying the .MYI
    (index), .MYD (data) and .frm (structure) files for each table has worked.

    If you can't do the transfer as 'root' chown -R the owner/group and
    restore to mysql:mysql at the other end.

    That should be sufficient if you're not replacing a table. If you are
    replacing a table, the server may have the original files open and will
    carry on using them. Fortunately I can shut-down the server while doing
    this.

    Somewhat slower and safer would be a mysqldump from the remote computer
    piped into mysql for the destination computer. I think this should work
    with all 'real' engines and may be necessary when moving between MySQL
    versions (I used it moving from v5.0 to v4.0 with appropriate switches).
    I don't use it currently because I'm mostly transferring packed MyISAM
    tables and I want them to stay packed!

    Chad

    --
    Chad Hanna
    Systems Developer FamilyHistoryOnline www.familyhistoryonline.net
    FreeBSD Apache MySQL Perl mod_perl PHP
    Chad Guest

  3. #3

    Default Re: transferring MySQL databases from one machine to another

    "Navodit" <edu> wrote:
     

    Technically this "backup database here" and "restore the backup there".
    So please consult the manual on howto backup and restore MySQL data.

    http://dev.mysql.com/doc/refman/5.0/en/disaster-prevention.html


    XL
    --
    Axel Schwenke, Senior Software Developer, MySQL AB

    Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
    MySQL User Forums: http://forums.mysql.com/
    Axel Guest

Similar Threads

  1. Connect To Remote MySQL Using VB6 On Client Machine !
    By lovely_angel_for_you@yahoo.com in forum MySQL
    Replies: 3
    Last Post: November 2nd, 01:51 PM
  2. Replies: 6
    Last Post: September 19th, 08:28 AM
  3. MySQL Databases lost
    By Stephane M in forum MySQL
    Replies: 3
    Last Post: April 5th, 03:34 PM
  4. [charter] comp.databases.mysql
    By Woodchuck Bill in forum MySQL
    Replies: 5
    Last Post: October 7th, 01:50 PM
  5. Searching MySQL databases with PHP
    By Richard Conway in forum PHP Development
    Replies: 1
    Last Post: July 29th, 04:18 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139