Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Oct 2006 09:52:52 +0800
From:      "jan gestre" <freebsd.ph@gmail.com>
To:        "Jonathan Horne" <freebsd@dfwlp.com>,  "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: [OT] a mysql question
Message-ID:  <a25afc300610241852w2e076ddcmf2d37f3fff67e956@mail.gmail.com>
In-Reply-To: <200610241849.50723.freebsd@dfwlp.com>
References:  <200610241849.50723.freebsd@dfwlp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/25/06, Jonathan Horne <freebsd@dfwlp.com> wrote:
>
> typical OT thread apologies, but the truth *really* is that this is the
> best
> and most intelligent list i read. so...
>
> i use veritas netbackup 5.1 to backup my bsd machines, and i would like to
> restore some mysql databases onto another machine.  is restoring any mysql
> database, as simple as reloading the database directories in
> /var/db/mysql?
> do i need to create the blank database first, then do it?
>
> i do know how to import a .sql database dump, i was just wondering if i
> can do
> it via a restore job from netbackup.  any opinions i can get, are greatly
> appreciated.
>
> i'm not a mysql guru but backing up and restoring a mysql database is just
like riding a bike, it's that easy :D

to backup a mysql database:

$ mysqldump -u user -p --opt databasename > database.bak.sql

to restore a database from the backup:

$ mysql -u user -p database < database.bak.sql

just make sure user has privileges to do the necessary commands, if not you
can use the root user of mysql. you can also use a gui tool like phpmyadmin
for managing mysql.

cheers



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