From owner-freebsd-questions@FreeBSD.ORG Mon Mar 5 15:31:49 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 201F616A401 for ; Mon, 5 Mar 2007 15:31:49 +0000 (UTC) (envelope-from raggen@passagen.se) Received: from av6-1-sn3.vrr.skanova.net (av6-1-sn3.vrr.skanova.net [81.228.9.179]) by mx1.freebsd.org (Postfix) with ESMTP id AE56B13C48E for ; Mon, 5 Mar 2007 15:31:48 +0000 (UTC) (envelope-from raggen@passagen.se) Received: by av6-1-sn3.vrr.skanova.net (Postfix, from userid 502) id 59E0538587; Mon, 5 Mar 2007 16:31:47 +0100 (CET) Received: from smtp3-2-sn3.vrr.skanova.net (smtp3-2-sn3.vrr.skanova.net [81.228.9.102]) by av6-1-sn3.vrr.skanova.net (Postfix) with ESMTP id 2A7CE38584; Mon, 5 Mar 2007 16:31:47 +0100 (CET) Received: from [192.168.1.6] (81-231-90-251-no41.tbcn.telia.com [81.231.90.251]) by smtp3-2-sn3.vrr.skanova.net (Postfix) with ESMTP id EBD3D37E53; Mon, 5 Mar 2007 16:31:46 +0100 (CET) Message-ID: <45EC3859.2010306@passagen.se> Date: Mon, 05 Mar 2007 16:33:45 +0100 From: Roger Olofsson User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: "Dr. Jennifer Nussbaum" References: <31636.77056.qm@web53410.mail.yahoo.com> In-Reply-To: <31636.77056.qm@web53410.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Starting MySQL with different database directory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2007 15:31:49 -0000 Hello Dr. Nussbaum, I do this quite alot but I prefer to do it like this: 1. stop mysqld. 2. copy the /var/db/mysql to 3. rename /var/db/mysql to keep the original (just in case) 4. create a symlink in /var/db that points to You create a symlink by issuing the following command (in /var/db) ln -s mysql replace with the correct path to where you want your database files. Good luck! Dr. Jennifer Nussbaum skrev: > I hope this is the right place--i looked over the MySQL docs but they talk about a different startup practice than what FreeBSD uses. > > I have a new install of MySQL 5.1 on a FreeBSD 6.2 system. I want to have my > MySQL data directory in a place other than /var/db/mysql. I thought i do this by > copying the appropriate my.cnf into /etc/my.conf and adding a line like "datadir = > /usr/local/mysql/var/" and making it readable to mysql user. But this doesnt work; > when i restart MySQL its still using /var/db/mysql. > > So i looked at the mysql-server startup script in /usr/local/etc/rc.d and added to > rc.conf "mysql_dbdir="/usr/local/mysql/var"". (I DON'T want to do it this way, > because i really want my MySQL related configuration things in my MySQL > configuration file, not split between there and my FreeBSD startup file. What if > i need to start mysql in some other way? But for now im just trying to see what > i can get to work.) This seemed to change something--mysqld had been running > when i made this change and when I ran "mysql-server stop" it couldnt stop, > because it was looking in /usr/local/mysql/var/foo.pid--i think this means it did > register the change to the new directory. But i couldnt then start it, because when > I run "mysql-server start" i get a "Can't connect to local MySQL server through > socket '/tmp/mysql.sock'" error. > > What's the right way to do this? Again id really prefer to do this all through the > my.cnf file, but this seems not to be getting read, at least for this reason. > > Thank you. > > Jen > > > --------------------------------- > Food fight? Enjoy some healthy debate > in the Yahoo! Answers Food & Drink Q&A. > _______________________________________________ > 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" > >