如何将数据复制到MYSQL另一个数据库中的表中 [英] How to copy data to a table which is in another database in MYSQL

查看:251
本文介绍了如何将数据复制到MYSQL另一个数据库中的表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我在不同的数据库中有两个结构相同的表,我想通过将现有条目保留在table.eg中来将一个表的内容复制到另一个表中.我在数据库1中有两个表a1和在数据库2中有a1.第一个表和第二个表具有不同的数据,我希望第一个表中的所有数据到第二个表中而不删除现有条目.如何做到这一点

在此先感谢
Amrutha

Hi all

i have two tables with same structure in different databases i want to copy content of one table to another by keeping existing entries in table.eg. I have two tables a1 in database one and a1 in database two.first table and second table has different data i want all data in first table to second table without deleting existing entries.How to do that

Thanks in Advance
Amrutha

推荐答案

如果您的数据库位于同一台计算机和同一台服务器上,请阅读以下内容:

http://stackoverflow.com/questions/25794/mysql-copy-duplicate-database [ ^ ]
If your databases are on the same machine and the same server, read the following :

http://stackoverflow.com/questions/25794/mysql-copy-duplicate-database[^]


我将表从一个导出到.csv文件,然后使用文本编辑器或电子表格对它们进行黑客入侵,以取出没有重复的主键,然后再将它们导入另一个.
使用phpmyadmin非常简单,只需转到表并单击导出"选项卡即可.
I''d export the tables from one into .csv files and then hack them with a text editor or spreadsheet to take out the no duplicate primary keys before importing them into the other one.

easy enough with phpmyadmin, just go to the table and click on the export tab...


这篇关于如何将数据复制到MYSQL另一个数据库中的表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆