From owner-freebsd-questions@FreeBSD.ORG Fri Aug 29 01:33:20 2003 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 662D416A4BF for ; Fri, 29 Aug 2003 01:33:20 -0700 (PDT) Received: from munk.nu (213-152-51-194.dsl.eclipse.net.uk [213.152.51.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5494D43FF7 for ; Fri, 29 Aug 2003 01:33:17 -0700 (PDT) (envelope-from munk@munk.nu) Received: from munk by munk.nu with local (Exim 4.22) id 19seh2-0000BE-7v for freebsd-questions@FreeBSD.ORG; Fri, 29 Aug 2003 09:33:16 +0100 Date: Fri, 29 Aug 2003 09:33:16 +0100 From: Jez Hancock To: freebsd-questions@FreeBSD.ORG Message-ID: <20030829083316.GA130@users.munk.nu> Mail-Followup-To: freebsd-questions@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: User Munk Subject: Re: MYSQL Fresh Reinstall, How? 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: Fri, 29 Aug 2003 08:33:20 -0000 On Fri, Aug 29, 2003 at 02:52:56AM -0400, Ben Dover wrote: > I managed to mess up my MYSQL4.1 on my 5.1 box and I can't seem to get it > straightened out. I think the best way to resolve this would be to do a > fresh install of MYSQL server. I did a pkg_delete of MYSQL-server and > client and installed again from ports but I'm getting the same error > messages. Is there a way to just start out fresh like I never had MYSQL > installed in the first place? The error I'm getting is: > 030829 2:36:36 Fatal error: Can't open privilege tables: Can't find file: > './mysql/host.frm' (errno: 13) > 030829 02:36:36 mysqld ended As the previous poster said you should first try restoring your mysql tables (the mysql database particularly '/var/db/mysql/' and it's children since it's the host.frm db file that's screwing up). If you're not too bothered about losing the data in your mysql db then you can just simply move the mysql db files totally: mv /var/db/mysql /var/db/mysql.bak and then reinstall from scratch (deinstall first if you haven't already, it'll complain but should succeed). You could then copy across the dbs from /var/db/mysql.bak back into /var/db/mysql after the reinstall and then recreate the mysql users with appropriate privs on the dbs. I _think_ this could work, but would be a pain. The best thing to do would be to just restore your mysql db from backup - you have those right!? (This was about the time when _I_ started to do backups regularly after having a similar problem:) -- Jez http://www.munk.nu/