Take a look at the mysqldump command

 mysqldump dbname > filename.sql
 echo "drop database dbname;" | mysql
 mysql dbname < filename.sql

On Fri, Oct 8, 2010 at 7:21 PM, nicolaas <[email protected]> wrote:
> Hi Gurus
>
> I was wondering how I can use PHP to save a mysql database as a file
> and then, in a second function, let the file replace my current
> database.  Can this be done in a few lines of PHP?
>
> Would it perhaps be better done outside PHP in a small bash script.
>
> I am proficient with PHP, but I am new to Server Scripting.
>
> Thank you
>
> - Nicolaas
>
> --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to