Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

MySQL-DB Backup via PHP

satharielsathariel Member Posts: 59
Hi,

i have a MySQL-Database on a Linux-PHP based webserver. I would like to make a backup of the database entries via an export to a file on my linux workstation at home.
The problems are:
- the backup should be automated, so doing this with phpmyadmin is no help.
- i have only webbased and ftp access to the server, so mysqldump is no option.
- the server isnt handled by a provider but by a friend of mine. Hes not doing the backup and i wont ask for one (its my discision).
- only one database on the server is mine/the webservers.
- im a "normal" sysadmin and have not much experience with either MySQL and PHP.

So, is there a program for doing such a backup? I really dont know where or what to look for anymore.
I dont have to watch out for inconsistencies and the like. The webprogram isnt transaction based. If data is lost, it is lost (wont be very much, maybe an incomplete insert which has to be dropped).

Any help would be nice

[black]SaThaRiel[/black]

[size=1][blue]Any time things appear to be going better, you have overlooked something.[/blue][/size]

Comments

  • quotientquotient Member Posts: 62
    [b][red]This message was edited by quotient at 2006-10-29 15:46:57[/red][/b][hr]
    [b][red]This message was edited by quotient at 2006-10-29 15:46:42[/red][/b][hr]
    : Hi,
    :
    : i have a MySQL-Database on a Linux-PHP based webserver. I would like to make a backup of the database entries via an export to a file on my linux workstation at home.
    : The problems are:
    : - the backup should be automated, so doing this with phpmyadmin is no help.
    : - i have only webbased and ftp access to the server, so mysqldump is no option.
    : - the server isnt handled by a provider but by a friend of mine. Hes not doing the backup and i wont ask for one (its my discision).
    : - only one database on the server is mine/the webservers.
    : - im a "normal" sysadmin and have not much experience with either MySQL and PHP.
    :
    : So, is there a program for doing such a backup? I really dont know where or what to look for anymore.
    : I dont have to watch out for inconsistencies and the like. The webprogram isnt transaction based. If data is lost, it is lost (wont be very much, maybe an incomplete insert which has to be dropped).
    :
    : Any help would be nice
    :
    : [black]SaThaRiel[/black]
    :
    : [size=1][blue]Any time things appear to be going better, you have overlooked something.[/blue][/size]
    :

    I think I have a script that can do that. Tell me if you still need it, and I'll try to find it... or write one in the worse case.
  • satharielsathariel Member Posts: 59
    : I think I have a script that can do that. Tell me if you still need it, and I'll try to find it... or write one in the worse case.
    :
    I still looking for a solution. It would be nice if you can support me with your script :)

    [black]SaThaRiel[/black]

    [size=1][blue]Any time things appear to be going better, you have overlooked something.[/blue][/size]

  • quotientquotient Member Posts: 62
    Sathariel,

    You can find the script here:
    http://www.quotient.ca/dl/_temp/mysqlbackup.zip

    It is coded to backup one database at a time though.

    Actually, the script is not automatic, you can fix that by changing the following lines:

    // Get parameters
    $host = ""; // You MySQL host here
    $user = ""; // Your DB username here
    $pass = ""; // Your password here
    $db = ""; // Your DB name here
    $filename = ""; // Filename here (ex.: backup.sql)

    You can still run multiple instances of the script. If you use a Unix platform, just change the lists and run it as "php mysqlbackup.php &" and everything will be done in the background. You can configure cron jobs, etc. Whatever you want.

    Tell me if you need help.

    Cheers,

    Francis

    : : I think I have a script that can do that. Tell me if you still need it, and I'll try to find it... or write one in the worse case.
    : :
    : I still looking for a solution. It would be nice if you can support me with your script :)
    :
    : [black]SaThaRiel[/black]
    :
    : [size=1][blue]Any time things appear to be going better, you have overlooked something.[/blue][/size]
    :
    :

  • satharielsathariel Member Posts: 59
    : Sathariel,
    :
    : You can find the script here:
    : http://www.quotient.ca/dl/_temp/mysqlbackup.zip
    :
    : It is coded to backup one database at a time though.
    :
    : Actually, the script is not automatic, you can fix that by changing the following lines:
    :
    : // Get parameters
    : $host = ""; // You MySQL host here
    : $user = ""; // Your DB username here
    : $pass = ""; // Your password here
    : $db = ""; // Your DB name here
    : $filename = ""; // Filename here (ex.: backup.sql)
    :
    : You can still run multiple instances of the script. If you use a Unix platform, just change the lists and run it as "php mysqlbackup.php &" and everything will be done in the background. You can configure cron jobs, etc. Whatever you want.
    :
    : Tell me if you need help.
    :
    : Cheers,
    :
    : Francis
    :
    : : : I think I have a script that can do that. Tell me if you still need it, and I'll try to find it... or write one in the worse case.
    : : :
    : : I still looking for a solution. It would be nice if you can support me with your script :)
    : :
    : : [black]SaThaRiel[/black]
    : :
    : : [size=1][blue]Any time things appear to be going better, you have overlooked something.[/blue][/size]
    : :

    Thank you very much. Sadly i cant test it at the moment, but when the new server is in place, i will check it :)

    regards
    [black]SaThaRiel[/black]

    [size=1][blue]Any time things appear to be going better, you have overlooked something.[/blue][/size]

Sign In or Register to comment.