Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

can any body tell me. I have a remote table from which I need to import part of the data and I need to place into my table which is in my computer(local). I know select-into command and its use but dont know use it for such kind of situations.

Thanks in advance

share|improve this question

migrated from serverfault.com Dec 17 '12 at 15:24

This question came from our site for professional system and network administrators.

add comment

2 Answers 2

up vote 1 down vote accepted

Try this from your local machine:

mysqldump -u username -p password -h remote_host --databases remote_database --tables remote_table --where="id=757575" | mysql local_database -u username -p password
share|improve this answer
    
Thanks for the format, Rolando. –  Valerie Parham-Thompson Dec 18 '12 at 3:39
    
thank you.......! –  Chella Dec 18 '12 at 4:31
add comment

To export the data from a remote table use below command you can also use where clause in it if u need specific data.

select * from tablename into outfile '/etc/tablename.csv';

use mysql>show create table tablename;

copy the create table statement and create a table in your local PC then Copy that 'tablename.csv' file from remote to your local computer. and use below to import data.

load data local infile '/etc/tablename.csv' into table tablename;

Any Issues let me know.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.