From: tedd on 17 Aug 2010 14:08 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 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? As for accessing a command line, I am still in the dark as to how to do that. Cheers, tedd -- ------- http://sperling.com/
From: Robert Cummings on 17 Aug 2010 14:17 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.
From: tedd on 17 Aug 2010 14:40 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/
From: Mari Masuda on 17 Aug 2010 14:45 On Aug 17, 2010, at 11:40 AM, tedd wrote: > 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). > > ------- Actually, mysqldump -u user -p password database_name > outfile.sql is also the incorrect command. When providing the password in the command, there should not be a space between the "-p" and the actual password. Try mysqldump -u user -ppassword database_name > outfile.sql and see if that gets you anywhere.
From: Robert Cummings on 17 Aug 2010 14:55 On 10-08-17 02:45 PM, Mari Masuda wrote: > > On Aug 17, 2010, at 11:40 AM, tedd wrote: > >> 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). >> >> ------- > > Actually, > > mysqldump -u user -p password database_name> outfile.sql > > is also the incorrect command. When providing the password in the command, there should not be a space between the "-p" and the actual password. Try > > mysqldump -u user -ppassword database_name> outfile.sql > > and see if that gets you anywhere. That's actually funny... I never put spaces in for the user or password when using the short parameter method and had quickly tried with the space before posting... I had tried with the user though and it work so I had assumed it worked for password also. 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.
|
Next
|
Last
Pages: 1 2 3 Prev: Including files on NFS mount slow with APC enabled Next: How safe is a .htaccess file? |