Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Aug 2003 09:33:16 +0100
From:      Jez Hancock <jez.hancock@munk.nu>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: MYSQL Fresh Reinstall, How?
Message-ID:  <20030829083316.GA130@users.munk.nu>
In-Reply-To: <Law11-F32QZaWcOrlVa0000c96b@hotmail.com>
References:  <Law11-F32QZaWcOrlVa0000c96b@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030829083316.GA130>