Jump to content


Photo

Backup MySQL using PHP


  • Please log in to reply
3 replies to this topic

#1 apitto

apitto
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 27 April 2006 - 06:17 AM

hai... could you help me with this problem. i just want to make a PHP script that could backing up mysql remotely. i dont want to access my server directly just to do this task.. please.
also any suggestion on how to upload file larger than 8MB using php..i can only upload about 6MB only...please.

#2 koencalliauw

koencalliauw
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 27 April 2006 - 06:30 AM

for backing up your MySQL db, you should check out the console command for mysqldump (or mysql_dump, I forgot) in combination with the exec() function.

for uploading bigger files, check the following

in php.ini

post_max_size = 8M; (set this to a higher number)
file_uploads = On; (make sure this is 'On')
upload_max_filesize = 8M (set this to a higher number)
memory_limit = 10M (set this somewhat higher than post_max_size)
max_execution_time (depending on the upload speed of client, you might want to set this to several minutes)

in httpd.conf (or whatever your apache config file is)
limitrequestbody = XXX (set this to your convenience)

Koen.

#3 apitto

apitto
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 27 April 2006 - 06:49 AM

i sorry, but i didn't work. only the upload is work but backup is not..please...
if you could post the code for backp...

#4 koencalliauw

koencalliauw
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 27 April 2006 - 06:51 AM

if you do not want to write the code yourself, take a look at this:

[a href=\"http://www.phpclasses.org/browse/package/2779.html\" target=\"_blank\"]http://www.phpclasses.org/browse/package/2779.html[/a]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users