mysqldump

Reply

Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

mysqldump

 
0
  #1
Jul 12th, 2007
Hi

Does anyone know what is the simplest way to backup a database using the mysqldump function in php?


I have googled a lot and the codes i have found are very hard to understand and most of them does not work.



Thanx in advance for your help.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: mysqldump

 
0
  #2
Jul 12th, 2007
If you are allowed to use exec() then that will make it a one line script. Otherwise you can't access mysqldump directly through PHP.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Re: mysqldump

 
0
  #3
Jul 12th, 2007
and how about restoring the db?
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 142
Reputation: MitkOK is an unknown quantity at this point 
Solved Threads: 12
MitkOK's Avatar
MitkOK MitkOK is offline Offline
Junior Poster

Re: mysqldump

 
0
  #4
Jul 12th, 2007
Originally Posted by stymiee View Post
If you are allowed to use exec() then that will make it a one line script. Otherwise you can't access mysqldump directly through PHP.
... or system()
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: mysqldump

 
0
  #5
Jul 12th, 2007
Originally Posted by cancer10 View Post
and how about restoring the db?
http://www.devshed.com/c/a/MySQL/Bac...QL-Database/2/

Originally Posted by MitkOK View Post
... or system()
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 142
Reputation: MitkOK is an unknown quantity at this point 
Solved Threads: 12
MitkOK's Avatar
MitkOK MitkOK is offline Offline
Junior Poster

Re: mysqldump

 
0
  #6
Jul 12th, 2007
Backup :

  1. $command = "mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]";

Restore :

  1. $command = "mysqldump -u [username] -p [password] [databasename] < [backupfile.sql]";

  1. system($commmand);

- Mitko Kostov
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 55
Reputation: atplerry is an unknown quantity at this point 
Solved Threads: 3
atplerry atplerry is offline Offline
Junior Poster in Training

Re: mysqldump

 
0
  #7
Jul 16th, 2007
this is nice one a really learn from it
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 831
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 136
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: mysqldump

 
0
  #8
Jul 19th, 2007
Mitko,

the restore command should be using mysql, not mysqldump.
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 142
Reputation: MitkOK is an unknown quantity at this point 
Solved Threads: 12
MitkOK's Avatar
MitkOK MitkOK is offline Offline
Junior Poster

Re: mysqldump

 
0
  #9
Jul 19th, 2007
Pritaeas, you are rigth. My bad.

- Mitko Kostov
Last edited by MitkOK; Jul 19th, 2007 at 11:51 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC