From owner-freebsd-questions@FreeBSD.ORG Wed Sep 8 19:19:38 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 DBD9E16A4CE for ; Wed, 8 Sep 2004 19:19:38 +0000 (GMT) Received: from destiny.chrononomicon.com (mail.chrononomicon.com [65.193.73.208]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4853943D2F for ; Wed, 8 Sep 2004 19:19:38 +0000 (GMT) (envelope-from bsilver@chrononomicon.com) Received: from [127.0.0.1] (destiny.chrononomicon.com [192.168.1.42]) by destiny.chrononomicon.com (Postfix) with ESMTP id 31D411FE26; Wed, 8 Sep 2004 15:19:06 -0400 (EDT) In-Reply-To: <200409031446.i83EkAi02437@clunix.cl.msu.edu> References: <200409031446.i83EkAi02437@clunix.cl.msu.edu> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Bart Silverstrim Date: Wed, 8 Sep 2004 15:19:09 -0400 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.619) Subject: Re: Moving MySQL database X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2004 19:19:39 -0000 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...) -Bart