On 12/02/11 3:42 PM, Raju s wrote:
> This also works.
> create the database in M2
> login to M1
>
>   mysqldump -a *dbname *-u *user *-p*password* | ssh
> *user*@*xxx.xxx.xxx.xxx*mysql -u
> *user* -p*password* *dbname*

You don't need ssh for this (unless of course both
hosts are located in an insecure network. You can
rather do this:

On M1 at MySQL prompt:
     GRANT SELECT ON employee_details
           FROM 'someuser'@'M2'
           IDENTIFIED BY 'somepassword';

On M2 at the Shell prompt:
      mysqldump -h M1 -u someuser -psomepassword \
           --databases employee_details | mysql \
           -u someuser -psomepassword

But as Raja mentioned, if there's a connection
failure, it might lead to data corruption even
in this case.

Better option than the above methods is to configure
M1 as a master and M2 as a slave and setup
replication amongst them.

Cheers,
Chandrashekar.

-- 
http://www.chandrashekar.info/
http://www.slashprog.com/
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to