Simon Wong <[EMAIL PROTECTED]> writes:

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

You can get rid of the password prompts.

On the remote host in ~/.my.cnf put

[client]
password        = supersecret
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

chmod 600 ~/.my.cnf

Actually, you'd probably want to do the same on both hosts.
You can then get rid of the -p switches.

-- 
Michael Chesterton              http://chesterton.id.au/blog/

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