Gentoo Archives: gentoo-user

From: kashani <kashani-list@××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] OT - Migrating databases to a new box
Date: Thu, 26 Apr 2007 22:14:59
Message-Id: 463121B8.9040109@badapple.net
In Reply to: [gentoo-user] OT - Migrating databases to a new box by Michael Sullivan
1 Michael Sullivan wrote:
2 > I'm currently in the process of migrating databases to a new box. One
3 > of my users has two databases that he needs access to. Is there a way
4 > (through the mysql terminal interface) to find out what passwords he
5 > uses to access these two databases? This will save me the trouble of
6 > finding him. (Most of my users access remotely). I have root
7 > privileges. Thank you for your help.
8
9 Why bother? User accounts are stored in the db. Just move the whole thing.
10
11 /etc/inti.d/mysql stop
12 rsync -av --delete /var/lib/mysql/ newbox01:/var/lib/mysql/
13
14 ssh newbox01
15 /etc/init.d/mysql start
16
17 This is can be slightly more complicated if you are changing db
18 versions and/or have vastly different options in the respective my.conf
19 files.
20
21 Or you can dump the mysql table and just copy the sql lines that you
22 care about if you're moving databases individually.
23
24 mysqldump -u root -p --skip-opt --databases mysql > mysql-db-20070436.sql
25
26 Then cut and paste any access lines from db and user into the new db.
27
28 Additionally you can get slick and replicate from the old box to the
29 new box. Then as you migrate individual database users over to the new
30 server you can stop replication on a per db basis. I can go through this
31 option if you're interested. I've done a number of Mysql
32 upgrade/migrations this way and it's easier than it might appear.
33
34 kashani
35 --
36 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] OT - Migrating databases to a new box Michael Sullivan <michael@××××××××××××.com>