same rows (inserts) as database1.table1 as database2.table1

using mysql workbench
I have 2 databases


I right clicked on a table

copy to clipboard
create statement

and ran the query in the other database without the database name

but how can I do the same rows (inserts) as database1.table1 as database2.table1
LVL 1
rgb192Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tomas Helgi JohannssonCommented:
Hi!

If the databases are on the same host you can issue

insert into database1.tablename select * from database2.tablename;

Regards,
    Tomas Helgi
0
rgb192Author Commented:
>>
http://dev.mysql.com/doc/workbench/en/wb-server-administration-manage-data-import-export.html


I can not do a data export because host is remote.


>>If the databases are on the same host you can issue

databases are not on the same host

I am accessing the databases my desktop computer using the same instance of mysql workbench
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

Tomas Helgi JohannssonCommented:
Hi!

Does one of the database reside on your computer or are they on the same or different remote hosts ?

If they are on the same remote host then you can easilly execute the insert statement I proveided.

Regards,
    Tomas Helgi
0
Easwaran ParamasivamCommented:
Both databases are in same server?

If so you could select rows from 1 table and insert in another

INSERT  DB2.dbo.table1
(col1, col2,..)

SELECT  
col1, col2
FROM  DB1.dbo.table1

If both the databases are in different servers then you can use Generate scripts option.

Right click on DB -> Generate scripts -> Select particular object (Table1) -> Advance option -> Data option -> Select Dataonly option.. This will generate insert scripts in the specified file. Copy it and run in on another server.. Thats it..

There are other options as well.. Linked serer.. Import Export wizards..

Please google on above topics so that you can get more idea on it.
0
rgb192Author Commented:
different hosts, different servers
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>I am accessing the databases my desktop computer using the same instance of mysql workbench

so you CAN use the workbench, as in the import, you just connect to the remote instance.
0
rgb192Author Commented:
is this 'database migration'

I can not find the option to 'export' for remote instance
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
not sure where exactly you are looking, and which version you have.
with 5.2.3, I connect to the (remote) instance [server adminstration], and go to the import from disk tab, and go on from there.
0
Tomas Helgi JohannssonCommented:
Hi!

In the version I have of the Mysql Workbench (version 5.2.47) you have two options.
1) Under the Server Administration section (in the home tab ) you have "Manage Import/Export" choice which is very trivial to use.
2) In the Menu there is a Database tab and under that tab you have "Schema Transfer Wizard" which is also very trivial to use and you can transfer the whole database or part of it.

Regards,
   Tomas Helgi
0
rgb192Author Commented:
this is in mysql workbench

with your tutorials I figured the answer

thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.