Mysql

Kevin Kinsey, DaleCo, S.P. kdk at daleco.biz
Thu May 29 12:00:17 PDT 2003


From: "BSD baby" <bsdlap at hitmedia.com>
To: "Ian Barnes" <ian at cerebellum.za.net>
Cc: <freebsd-questions at freebsd.org>
Sent: Thursday, May 29, 2003 11:16 AM
Subject: Re: Mysql


> > I want to remove my mysql installation and re-install from
scratch. Now the
> > problem. I have 6 active databases. How can i make sure that i
dont loose
> > those. And that when i have re-installed, that they work
immediatilly ??
>
> The databases are in /var/db/mysql
>
> The smartest thing would be to do (as root user):
>
> mysqladmin -u YourUsername -p shutdown
> cd /var/db/mysql
> tar cvfz MyDatabases.tgz *
> mv MyDatabases.tgz /home/
>
> That will stop your database server, and save all your data in your
/home/ dir.
>
> Then, when you want to restore them, IF they're not there after a
new install, just do:
>
> cd /var/db/mysql
> rm *
> tar xvfz /home/MyDatabases.tgz
>
There is also "mysqldump" with complete instructions
at the mysql.com website.  IIRC, it creates SQL language
files that would be used to entirely recreate the database
from the commandline once the new server is up & running.

HTH,

Kevin Kinsey
DaleCo, S.P.




More information about the freebsd-questions mailing list