From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1HhCVT-00055W-6a for garchives@archives.gentoo.org; Thu, 26 Apr 2007 22:32:07 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l3QMUx5e009515; Thu, 26 Apr 2007 22:30:59 GMT Received: from bullet.espersunited.com (adsl-70-234-122-249.dsl.tul2ok.sbcglobal.net [70.234.122.249]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l3QMQeXe004781 for ; Thu, 26 Apr 2007 22:26:41 GMT Received: from [70.234.122.250] (camille.espersunited.com [70.234.122.250]) by bullet.espersunited.com (8.14.0/8.13.7) with ESMTP id l3QMQdk2008144 for ; Thu, 26 Apr 2007 17:26:39 -0500 Subject: Re: [gentoo-user] OT - Migrating databases to a new box From: Michael Sullivan To: gentoo-user@lists.gentoo.org In-Reply-To: <463121B8.9040109@badapple.net> References: <1177623761.14916.2.camel@camille.espersunited.com> <463121B8.9040109@badapple.net> Content-Type: text/plain Date: Thu, 26 Apr 2007 17:26:39 -0500 Message-Id: <1177626399.14888.5.camel@camille.espersunited.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.8.2.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: bd18afed-d9e6-4984-8eef-07821e84fe8f X-Archives-Hash: 1ab8d24c751e4d946f570c12cfbfd5b1 On Thu, 2007-04-26 at 15:03 -0700, kashani wrote: > Michael Sullivan wrote: > > I'm currently in the process of migrating databases to a new box. One > > of my users has two databases that he needs access to. Is there a way > > (through the mysql terminal interface) to find out what passwords he > > uses to access these two databases? This will save me the trouble of > > finding him. (Most of my users access remotely). I have root > > privileges. Thank you for your help. > > Why bother? User accounts are stored in the db. Just move the whole thing. > > /etc/inti.d/mysql stop > rsync -av --delete /var/lib/mysql/ newbox01:/var/lib/mysql/ > And this method will preserve all granted permissions with their passwords? That would be great! > ssh newbox01 > /etc/init.d/mysql start > > This is can be slightly more complicated if you are changing db > versions and/or have vastly different options in the respective my.conf > files. > > Or you can dump the mysql table and just copy the sql lines that you > care about if you're moving databases individually. > > mysqldump -u root -p --skip-opt --databases mysql > mysql-db-20070436.sql > > Then cut and paste any access lines from db and user into the new db. How do I get those? > > Additionally you can get slick and replicate from the old box to the > new box. Then as you migrate individual database users over to the new > server you can stop replication on a per db basis. I can go through this > option if you're interested. I've done a number of Mysql > upgrade/migrations this way and it's easier than it might appear. > > kashani -- gentoo-user@gentoo.org mailing list