On Tuesday 19 June 2007 10:00, [EMAIL PROTECTED] wrote:
> I'm trying to dump a MySQL DB from one host and import it directly into
> another MySQL server using SSH.  The catch is that I want to "pull"
> rather than push (which is quite easy).
>
> What I am trying to do is...
>
>         $ ssh DBMASTER "mysqldump --opt -u root -p live" | mysql -u dbuser
> -p live Enter password: [EMAIL PROTECTED]'s password:
>         ERROR 1045 (28000): Access denied for user 'dbuser'@'localhost'
> (using password: YES) 
> But I end up with both password prompts (SSH and MySQL) coming up at the
> same time so it fails.
>
> Any SSH gurus out there that can help with this?

This must not be
mysqldump --opt -u root -p live

it must be
mysqldump --opt -u root -plive

Then you need to be consistant (what is --opt ??)
[tigger] /home/jam [55]% mysqldump --opt -u root -psecret
Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help

Dump a database creates tables, but does not create databases. Once the 
nuances are sorted the ssh command DOES work
ie --all-databases works

James
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to