Copying MySQL database files between machines

Copying MySQL database files between machines

am 23.05.2006 21:06:23 von Israel

I'll preface this by saying that my preference is to dump a database to
SQL and transfer that file around but this is not the situation that
I'm in and I'll probably be in this situation in future..

I have all of the files from under C:\Program Files\MySQL\MySQL Server
4.1\data that were copied from another machine while mysqld-nt.exe was
still running. I thought that maybe I could copy these files over to
my machine, after first removing all of the current files. When I
tried to do this I first shut down mysqld-nt.exe then I removed all of
the files under the data folder and then I copied all of the files from
the other machine's data folder.

After doing this I can longer start the mysqld-nt.exe service until I
revert all of the data files back to their original. When I attempt to
start the service I get the following errors logged to the event log:

Server Control Manager:
"The MySQL service terminated unexpectedly."

MySQL:
"Can't init databases"
"Aborting"

Does anyone have any ideas how I can get this database back up or
possibly extract data from the files?

-Israel

Re: Copying MySQL database files between machines

am 23.05.2006 21:21:34 von Israel

After trying it again I did the same thing except I deleted the
machinename.err and machinename.pid files before attempting to start
the service. The service *appeared* to start but the same error
messages were logged to the event log and I got the following message
from MySQL Query Broswer trying to login:

Could not connect to the specified instance.
MySQL Error Number 2003
Can't connect to MySQL server on 'localhost' (10061)

Shutting down the service resulted in this error and nothing
interesting logged to the event log:
Error 1067: The process terminated unexpectedly