From owner-freebsd-questions@FreeBSD.ORG Wed Oct 25 01:53:09 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 3C6B516A417 for ; Wed, 25 Oct 2006 01:53:09 +0000 (UTC) (envelope-from freebsd.ph@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id C840343D8C for ; Wed, 25 Oct 2006 01:52:53 +0000 (GMT) (envelope-from freebsd.ph@gmail.com) Received: by nz-out-0102.google.com with SMTP id o37so597nzf for ; Tue, 24 Oct 2006 18:52:53 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ehDkfTdhsVKRq0Ms0HY1g+Q91VclKDwlBgCOiSMsq8OSsnZzo6uekFOLGkzpjIowLSAfcAm9f5U/X86Eb49HFjnT1FQZ4caCFXR9+EnDmTUA+76oRuPh7nRPGHK5D0ZmyaeptaWvNfdYm8quNRV+wGCXfhlcnZ0P0JY3r21/yUE= Received: by 10.64.210.3 with SMTP id i3mr8576213qbg; Tue, 24 Oct 2006 18:52:53 -0700 (PDT) Received: by 10.65.103.4 with HTTP; Tue, 24 Oct 2006 18:52:51 -0700 (PDT) Message-ID: Date: Wed, 25 Oct 2006 09:52:52 +0800 From: "jan gestre" To: "Jonathan Horne" , "freebsd-questions@freebsd.org" In-Reply-To: <200610241849.50723.freebsd@dfwlp.com> MIME-Version: 1.0 References: <200610241849.50723.freebsd@dfwlp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: [OT] a mysql question 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: Wed, 25 Oct 2006 01:53:09 -0000 On 10/25/06, Jonathan Horne 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