From: Jason Pruim on


On Aug 17, 2010, at 3:19 PM, tedd <tedd(a)sperling.com> wrote:

> At 11:45 AM -0700 8/17/10, Mari Masuda wrote:
>> 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.
>
> Bingo -- that worked.
>
> It's interesting that a space is optional between -u and user, but required to be absent between -p and password. Seems not symmetrical to me

Tedd... Goad you got the answer you needed as far as safely attacking the command line if my memory serves me correctly you are on a Mac so What you are looking for is a program called terminal.

It's in the utilities folder of your harddrive. Then what you would do is assuming your host supports ssh is simply type into the terminal application: ssh yourUzerName(a)yourDomain

Say yes when it asks if you want to store the encryption key (I think that's what it's called) and then enter your password. Once all of that is done then just type in the command that was given and it will create the file just as you requested.

Now I typed all that for the archives since you found a way to do t with exec but I'm always happy to help the archives where I can :)

Have a great night!

From: "Daniel P. Brown" on
On Tue, Aug 17, 2010 at 15:19, tedd <tedd(a)sperling.com> wrote:
>
> Bingo -- that worked.
>
> It's interesting that a space is optional between -u and user, but required
> to be absent between -p and password. Seems not symmetrical to me.

The command I sent was because - as I said in the original thread
- passing any password directly to the command line is Very Bad[tm].
If you're passing it via exec(), though, and don't want to use an
'expect' shell, passing it directly to -p is at least a bit less
dangerous. Plus, doing so will not leave anything in your
~/.bash_history on the server.

That said, sorry for appearing inattentive, despite this being
directed right at me. I have been out of the office more than in for
the last couple of weeks, while working on a ton of new stuff.
Eventually it will go back to "normal."

--
</Daniel P. Brown>
UNADVERTISED DEDICATED SERVER SPECIALS
SAME-DAY SETUP
Just ask me what we're offering today!
daniel.brown(a)parasane.net || danbrown(a)php.net
http://www.parasane.net/ || http://www.pilotpig.net/
From: "Jan G.B." on
2010/8/18 Daniel P. Brown <daniel.brown(a)parasane.net>:
> On Tue, Aug 17, 2010 at 15:19, tedd <tedd(a)sperling.com> wrote:
>>
>> Bingo -- that worked.
>>
>> It's interesting that a space is optional between -u and user, but required
>> to be absent between -p and password. Seems not symmetrical to me.
>
>    The command I sent was because - as I said in the original thread
> - passing any password directly to the command line is Very Bad[tm].
> If you're passing it via exec(), though, and don't want to use an
> 'expect' shell, passing it directly to -p is at least a bit less
> dangerous.  Plus, doing so will not leave anything in your
> ~/.bash_history on the server.
>
>    That said, sorry for appearing inattentive, despite this being
> directed right at me.  I have been out of the office more than in for
> the last couple of weeks, while working on a ton of new stuff.
> Eventually it will go back to "normal."
>
> --
> </Daniel P. Brown>
> UNADVERTISED DEDICATED SERVER SPECIALS
> SAME-DAY SETUP
> Just ask me what we're offering today!
> daniel.brown(a)parasane.net || danbrown(a)php.net
> http://www.parasane.net/ || http://www.pilotpig.net/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I recommend gzipping it on the fly and if you're using own MYSQL
functions and /or stored procedures, then I'd add --routines as
parameter to include these in your sum.
Here's my command line:


$ mysqldump -u USERNAME -p --opt --single-transaction --routines
DATABASENAME | gzip > sqldump.sql.gz


Note that you must only replace Databasename and Username in the
example.. mysqldump will ask for the passwort.
If you specify your password in the command line, then you end up
haviung it in your shell history which can make it easy for crackers.

--opt means the same as:
--add-drop-table, --add-locks, --create-options,
--quick, --extended-insert, --lock-tables, --set-charset,
and --disable-keys.
and is enabled by default.


Regards