If you don't need the file afterwards, you can do it in one line of your favourite shell
mysqldump --add-drop-database -u <username> --password=<password> --databases <database> | mysql -u <username> --password=<password> On 8/10/2010, at 9:21 PM, nicolaas 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] --- Simon Welsh Admin of http://simon.geek.nz/ Who said Microsoft never created a bug-free program? The blue screen never, ever crashes! http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e -- NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected]
