Question

i'm developing a php web application and wondered how to backup the database.

i found mysqldumper, but i dont really have an idea how to force mysqldumper to make a backup within my web application.

well, and i dont like the idea of having a user, who does not have a clue of databases, who has access to mysqldumper and must click himself through mysqldumper-application to make a manual backup.

does anyone have experience with this?

i think calling the "filemanagement.php" with appropriate params would do it, but i cannot think of how will i handle the page-reload behavior...

otherwise, does anyone know a proper alternative to mysqldumper, which is easily callable within an php application?

Was it helpful?

Solution

I found a solution on this website: Perform a MySQL dump with PHP

<?php 

set_time_limit(600);

system("mysqldump -h localhost -u YOURUSERNAME -p YOURPASSWORD YOURDATABSENAME > /usr/local/www/vhosts/YOURDOMAIN.CO.NZ/private/BACKUPFILENAME.sql");

?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top