From owner-freebsd-questions@FreeBSD.ORG Thu Sep 9 01:19:01 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3683116A4CE for ; Thu, 9 Sep 2004 01:19:01 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB27843D58 for ; Thu, 9 Sep 2004 01:18:58 +0000 (GMT) (envelope-from clsung@gmail.com) Received: by mproxy.gmail.com with SMTP id v18so283677rnb for ; Wed, 08 Sep 2004 18:18:47 -0700 (PDT) Received: by 10.38.2.80 with SMTP id 80mr1741964rnb; Wed, 08 Sep 2004 18:18:46 -0700 (PDT) Received: by 10.38.8.67 with HTTP; Wed, 8 Sep 2004 18:18:46 -0700 (PDT) Message-ID: <8c0cd475040908181870e14639@mail.gmail.com> Date: Thu, 9 Sep 2004 09:18:46 +0800 From: "Alan, Cheng-Lung Sung" To: Jerry McAllister In-Reply-To: <200409082040.i88Ke1L27271@clunix.cl.msu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <200409082040.i88Ke1L27271@clunix.cl.msu.edu> cc: freebsd-questions@freebsd.org cc: Bart Silverstrim Subject: Re: Moving MySQL database X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Alan, Cheng-Lung Sung" List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2004 01:19:01 -0000 Hi, Why not just use mysqldump --alldatabases ? Export all, then import all. It can make sure all your DB data consistency. Regards, On Wed, 8 Sep 2004 16:40:01 -0400 (EDT), Jerry McAllister wrote: > Hi, > > > On Sep 3, 2004, at 10:46 AM, Jerry McAllister wrote: > > >> I have a server that is rapidly filling the var partition with a MySQL > > >> database. I'd like to move it to a subdirectory somewhere under /usr. > > > > > If you don't want to move all the stuff in /var/db, then you will > > > have to be more selective and make the link from within /var/db > > > rather than just the whole db directory from within /var. > > > > > > For example, the MySQL stuff is likely to all be in a directory > > > called /var/db/mysql. So: > > > > > > Stop MySQL or reboot to single user. > > > Then > > > cd /var/db/mysql > > > tar cf /usr/mysql.tar * > > > cd /usr > > > mkdir var.db.mysql > > > cd var.db.mysql > > > tar xf ../../mysql.tar > > > cd /var/db > > > mv mysql mysql.old > > > ln -s /usr/var.db.mysql mysql > > > Now, reboot and let MySQL start and make sure it all is happy and > > > works just fine. > > > Then clean up. > > > cd /usr > > > rm mysql.tar > > > cd /var/db > > > rm -rf mysql.old > > > > > > ////jerry > > > > Thank you to everyone who replied. I followed the above steps and the > > SQL server seems to be happy and running on the /usr partition instead > > of /var for now. We'll be watching it, and if all seems to be working > > well, we'll delete the old data off /var. > > > > Thanks again! (especially for the specific directions on moving the > > data over, Jerry...) > > Good. I am glad it works for you. > It seemed to be shorter and more clear to just make an example than > to try and write out an explaination for it. > > ////jerry > > > > > > > -Bart > > > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > -- COBRA Lab in NTU EE IAS Lab in SINICA IIS