Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] OT - Migrating databases to a new box kashani <kashani-list@××××××××.net>