Re: mysqldump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 2:17 PM -0400 8/17/10, Robert Cummings wrote:
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


I did catch that, but did not correct it in my post (considering it was a direct quote).

-------

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.


No, I didn't -- however, I just did this (using the correct user, password, and database name):

  exec('mysqldump  -u user -p password databaseName > outfile.txt',$a,$b);

And received back an empty array for $a and '2' for $b. I don't know what that means.


-------
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

I'm neither on Windozes nor the host. I am on a hosted account and that may be the problem. However, I've been told that I *can* access the command line, I am just clueless as to how to do it.

In the past I have been reluctant to try because I don't want to screw things up. You see, it's Okay if I screw up my own system, but someone else's, I would rather not. However, I would like to know how to do it safely.

Thanks for your time.

Cheers,

tedd

--
-------
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux