MySQL Forums
Forum List  »  Newbie

How to copy table to another database ?
Posted by: user norm
Date: August 08, 2018 03:25AM

This operation is so basic and is offered by all other databases db_link function.

However in MySQL this seems impossible.


I have a connection to `mySQL` on `redShift` as follows:

jdbc:redshift://conn/setA

in `setA` I have table called: `Orders` in schema called: `onlineStore`


I want to copy this table with data to:

jdbc:redshift://conn/setB

into schema called : `onlineStoreProduction`

the `conn` is the same for both meaning both databases are on the same cluster.


The code should be something like:

CREATE TABLE `onlineStoreProduction.Orders` LIKE `onlineStore.Orders`;
INSERT INTO `onlineStoreProduction.Orders` SELECT * FROM `onlineStore.Orders`;

However this code won't create the table in `setB`. it will create it in `setA`.

How can I solve this?

Options: ReplyQuote


Subject
Written By
Posted
How to copy table to another database ?
August 08, 2018 03:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.