0

I'm trying to transfer Mysql data to another computer and add it to an exist database

Here is the condition:
1. Computer A, A has a database named 'Test';
2. Computer B, B has a database named 'Formal';
3. Test and Formal have exactly the same tables and fields.
4. I use A to get new data and add the data to B.
5. Remote connection to B's MySQL is forbidden.

Here is how I deal with it now:
1. Create a 'Transfer' database in B;
2. Dump Source's data into test.sql;
3. Copy test.sql to B;
4. Backup Formal database;
5. Source test.sql to Transfer database.
6. Use a script to take Transfer's data and add to Target.

I am wondering if I can add Test's data into Formal database directly?

I am not a native English speaker and fresh new in MySQL, so if there is any confusion upthere, please tell me and i'll try my best to make it clear.

migrated from stackoverflow.com Sep 3 '14 at 9:53

This question came from our site for professional and enthusiast programmers.

  • Is this a Read-Write -splitting case? – heikkim Sep 3 '14 at 7:01
  • this command should do the task for you - mysqldump -h oldhost -u oldusername -poldpassword olddbname | mysql -h newhost -u newusername -pnewpassword newdbname – Murtaza Sep 3 '14 at 7:03
  • @Murtaza: Remote connection to computer B is forbidden. But i am now working on mysqldump to see if i can do something else with it. Thanks! – Song Sep 3 '14 at 14:33
  • @heikkim: I don't know exactly what 'Read-Write -splitting' is, but i don't think it is. – Song Sep 3 '14 at 14:46
  • How do you do "3. Copy test.sql to B;" if you have no remote access to B? Copy the test.sql to a USB stick, then ship the stick to location B? – ypercubeᵀᴹ Sep 4 '14 at 13:15
0

In MySql you can it import it in the GUI

http://www.phpmyadmin.net/home_page/images/screenshots/users.png

there you can import and export it with a data.sql

or you you save the data from A in an dataset and then you update the dataset in the b database or other around so you have copy the database B to A

p.s. admins pls put the image in i cant do it

p.s.billy i explained it with the image

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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