From owner-freebsd-questions@FreeBSD.ORG Mon Mar 5 16:38:43 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 6F3A716A400 for ; Mon, 5 Mar 2007 16:38:43 +0000 (UTC) (envelope-from bg271828@yahoo.com) Received: from web53414.mail.yahoo.com (web53414.mail.yahoo.com [206.190.39.74]) by mx1.freebsd.org (Postfix) with SMTP id 30CF013C4AA for ; Mon, 5 Mar 2007 16:38:43 +0000 (UTC) (envelope-from bg271828@yahoo.com) Received: (qmail 25778 invoked by uid 60001); 5 Mar 2007 16:38:42 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=UdNTJyVinKCtKYbtNB73q/G+9LbtEOwxKzkqyGqhedtbr9PR/8XGMApepIr2dbmo4jZV2fN8lfBzJLaHQL66iMUUBirW0zF5w3CWUXvvhkTYx2AUOKXsQf2GWB74KZ/CL5ZZ6ZcmS8cnw1GErtFhKgTD5GJLBg3IwA/mwJFeJ5I=; X-YMail-OSG: BuhJabgVM1k7aVOB08M3WoxryeO4mzGsEtXqi4Lu.spz_TMfPRtWmMNLINzOvVIvYg-- Received: from [12.182.77.130] by web53414.mail.yahoo.com via HTTP; Mon, 05 Mar 2007 08:38:42 PST Date: Mon, 5 Mar 2007 08:38:42 -0800 (PST) From: "Dr. Jennifer Nussbaum" To: Kalashnikov Ilya In-Reply-To: <1173111798.16006.5.camel@n-ss.nighterra> MIME-Version: 1.0 Message-ID: <538532.25461.qm@web53414.mail.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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 16:38:43 -0000 Kalashnikov Ilya wrote: On Mon, 2007-03-05 at 07:05 -0800, Dr. Jennifer Nussbaum wrote: 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" Hi Dr. Jennifer Nussbaum. Need append to /etc/rc.conf follow line: mysql_dbdir="/mysql/db/location" See please /usr/local/etc/rc.d/mysql-server.sh Thats exactly what i did, if you look at what i wrote above. But when i do that i cant start the server. (And as i said i also would like to have this in my MySQL configuration file, not in a FreeBSD configuration file.) Also, replying to a separate email from Roger Olofsson about just symlinking /var/db/mysql to somewhere else: sure, i can do that, and i once had to do that quickly when i accidently filled up my /var partition :-(. But here i have a new install and i KNOW i want the data directory to go somwhere else, so id like to do it by specifying it in the conf file and not by symlinking which has always felt like a kluge to me. Jen --------------------------------- Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games.