location of mysql database files?

Rick Stevens rstevens at vitalstream.com
Mon Jul 25 17:36:14 UTC 2005


Harold Hallikainen wrote:
> THANKS! I'm trying to keep an updated hot standby running, so I'll first
> try moving them with rsync. If that doesn't work, I'll try export/import.

We prefer bottom posting here, Harold.

The only _reliable_ method for moving mysql data from machine to machine
is via mysqldump/mysqlrestore or by using the replication tools in the
later versions of mysql.  Moving the data files around is not
recommended--especially with a live database.  If you can stop it while
you move the binary files, then you're OK, but don't do it while mysql
is running.

BTW, the default location for the data files is

	/var/lib/mysql/name-of-database

Inside each directory, the files are named *.frm, *.MYD, and *.MYI,
where the asterisks are replaced by the table names.  10 tables yields
30 files (a .frm, a .MYD and a .MYI for each)

> 
> THANKS!
> 
> Harold
> 
> 
> 
>>Harold Hallikainen wrote:
>>
>>
>>>I'm SLOWLY bringing up a new server and moving stuff from the old to the
>>>new. My next issue is moving over mysql database files. If someone knows
>>>off the top of their head what they're called and where they are, it'd
>>>save me a bunch of research. They are currently buried deep in an RH8
>>>machine, and I'll be moving them to an FC4 machine.
>>>
>>>THANKS!
>>>
>>>Harold
>>>
>>>
>>>
>>>
>>
>>The files are stored in /var/lib/mysql. You will find one directory of
>>fields for each database you have created.
>>
>>You would probably be better off if you used mysqldump to create an
>>ascii dump of the database, moved that to the new server and then use
>>mysqlimport to import the data to the new database.
>>
>>
>>
>>Carl.
>>
>>
>>
>>_______________________________________________
>>Redhat-install-list mailing list
>>Redhat-install-list at redhat.com
>>https://www.redhat.com/mailman/listinfo/redhat-install-list
>>To Unsubscribe Go To ABOVE URL or send a message to:
>>redhat-install-list-request at redhat.com
>>Subject: unsubscribe
>>
> 
> 
> 


-- 
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-    Reality: A crutch for those who can't handle science fiction    -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list