Moving a MySQL installation?
Don Levey
lug at the-leveys.us
Fri Apr 13 19:54:09 EDT 2007
Hunter Heinlen wrote:
> Don Levey wrote:
>
>> 1) Take the data files and move them wholesale to the new machine. If
>> this is possible, everything comes over at once and when I start sqld
>> everything "just works".
>
> I did this recently to move a Geeklog site from an old server running
> RHEL3 to one running RHEL5. Worked fairly well, assuming that you are
> not making big jumps in the versions of mysql you are using.
>
I'm coming from Fedora Core 4 to CentOS 5 (RHEL5). That translates as
MySQL 4.1.20 to 5.0.22.
>> If #1 is a possibility, what files should I move over?
>
> /var/lib/mysql and its children is the most likely candidate. Look for
> the data directory in /etc/my.cnf to find out for certain. Also, be
> aware that sockets will not be moved by scp, tar, etc, and they are not
> always recreated if you just /etc/init.d/mysqld restart. Many programs
> connect to mysql through a socket, and some distros put it into
> /var/lib/mysql instead of the safer /tmp.
>
> Hunter
Cool - I can do that. I tend to put all my sockets in /var/run if I
can, so that they're all in one place. I've not seen anything that
doesn't recreate the sock file upon restart, but that doesn't mean it
doesn't happen. Thanks!
-Don
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Discuss
mailing list