By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,543 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

mysql export fields mapping

P: 59
hi,
i have two databases and each one have diferent fields names and tables
and i want a creat a map for each field and each table and export to a database to the other
i have tested the mysql migration but i canīt choose a diferent table in the destination
database.
any one know a software that does this?
thanks a lot for your help
:)
Dec 29 '11 #1
Share this Question
Share on Google+
1 Reply


Atli
Expert 5K+
P: 5,058
You can "copy" a table from one database to another, even if the field names don't match, with a simple INSERT INTO ... SELECT query.

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO `db2`.`newTable` (`new1`, `new2`, `new3`)
  2. SELECT `old1`, `old2`, `old3` FROM `db1`.`oldTable`;
  3.  
You could create some sort of a script or application to move the entire database, but seeing as you have to type of the field map anyways you may as well just type out the SQL queries into a .sql file and then execute it.
Dec 29 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.