From owner-freebsd-questions@FreeBSD.ORG Mon Apr 6 18:08:22 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06790106568E for ; Mon, 6 Apr 2009 18:08:22 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: from mx1.identry.com (on.identry.com [66.111.0.194]) by mx1.freebsd.org (Postfix) with ESMTP id AB4EB8FC16 for ; Mon, 6 Apr 2009 18:08:21 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: (qmail 31655 invoked by uid 89); 6 Apr 2009 18:08:58 -0000 Received: from unknown (HELO ?192.168.1.110?) (jalmberg@75.127.142.66) by mx1.identry.com with ESMTPA; 6 Apr 2009 18:08:58 -0000 Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: References: <4ad871310904050141k11eda14vd8db9224f4384757@mail.gmail.com> <1ED100F1-51AE-478D-873C-40FF43EA17FB@identry.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: John Almberg Date: Mon, 6 Apr 2009 14:08:18 -0400 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.753.1) Subject: Re: how to recover after power outage 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, 06 Apr 2009 18:08:22 -0000 >> Check the machine-hostname.err file when you manually try and >> start MySQL. >> Provided that you have mysql_enable="YES" in /etc/rc.conf you >> should be able >> to manually attempt to start with /usr/local/etc/rc.d/mysql-server >> start (it >> seems to work reliably when you type out the entire command path- >> wise). >> >> Note that if somehow permissions on the my.cnf file got changed >> MySQL won't >> start if my.cnf is world writable. Check for stale PID and >> sockets. Normally >> these shouldn't be a problem as a startup will just overwrite >> them. Check >> these to eliminate any wonkiness, e.g. some permission change >> isn't allowing >> for MySQL to wipe the old ones. >> >> The whateverthehostname.err log and possibly /var/log/messages >> might give >> some clue for what's going on. If the database files are corrupt >> just clean >> them out and replace with a backup done with dump. Ensure the /var/ >> db/mysql >> tree is chowned mysql:mysql. If you had to install/reinstall from >> ports the >> install should have created the appropriate uid/gid accounts. >> Check and see >> if these are missing. >> >> At any rate I wish you the best of luck. Now that you can SSH in >> you can >> probably fix it up. > Okay, so my new database server is running with backup data and I am trying to salvage the old database, or what's left of it. Unfortunately, it seems like what's left of it, is not much. the /var/db/mysql directory tree is now a file: qu# ls -l /var/db/mysql -rwx------ 2 mysql wheel 1024 Jul 5 2008 /var/db/mysql The situation looks hopeless to me. Is it? Another question: given that the file system took a major hit, should I try to fix it, or just do a clean install? I'm leaning towards the clean install since I've been meaning to upgrade this machine to 7.1 anyway. Is there anyway to fix the file system, reliably? fsck doesn't seem to be able to solve all the problems. -- John