Re: [PHP] mysqldump

[email protected] (Robert Cummings)
Newsgroups php.general
Organization InterJinn
Message-ID <[email protected]>

On 10-08-17 02:08 PM, tedd wrote:
> Hi gang:
>
>> At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
>>      Easiest method, from the command line on the server from which you
>> want to dump the database:
>>
>>          mysqldump -u user -p database_name>  outfile.sql

Command is wrong... should be:

     mysqldump -u user -p password database_name > outfile.sql

> That might be the easiest, but all I get is an empty file.
>
> I've tried many different variations of the syntax using exec(), but
> nothing produces any subsistent output. What am I doing wrong?

Have you checked the return code of running exec? It may be the 
mysqldump program isn't in your path.

> As for accessing a command line, I am still in the dark as to how to do that.

In windows you can do Start -> Run -> cmd.exe to load the command prompt 
terminal. You could probably put the above mysqldump command directly 
into the run prompt, but I don't know what it's default path is... but a 
small tweak might be:

     C:\PATH\TO\mysqlump -u user -p password database_name > C:\outfile.sql

Cheers,
Rob.
-- 
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.