将数据库从mysql转换为mongoDb [英] converting database from mysql to mongoDb

查看:695
本文介绍了将数据库从mysql转换为mongoDb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有任何简单的方法来将数据库从mysql更改为mongoDB?



或更好任何一个建议我好的教程做它


方法1 :以CSV格式从MySQL导出,然后使用 mongoimport工具



方法2 :使用您的语言脚本转移选择。基本上你写一个程序,从MySQL一个元素读取一切,然后将其插入到MongoDB。



方法#2比#1好,但它仍然不足。



MongoDB使用集合而不是表。 MongoDB不支持连接。在我看过的每个数据库中,这意味着你的MongoDB中的数据结构与MySQL中的结构不同。



正因为如此,没有通用工具用于将SQL移植到MongoDB。您的数据需要在到达MongoDB之前进行转换。


is there any easy way to change the database from mysql to mongoDB ?

or better any one suggest me good tutorial do it

解决方案

is there any easy way to change the database from mysql to mongoDB ?

Method #1: export from MySQL in a CSV format and then use the mongoimport tool. However, this does not always work well in terms of handling dates of binary data.

Method #2: script the transfer in your language of choice. Basically you write a program that reads everything from MySQL one element at a time and then inserts it into MongoDB.

Method #2 is better than #1, but it is still not adequate.

MongoDB uses collections instead of tables. MongoDB does not support joins. In every database I've seen, this means that your data structure in MongoDB is different from the structure in MySQL.

Because of this, there is no "universal tool" for porting SQL to MongoDB. Your data will need to be transformed before it reaches MongoDB.

这篇关于将数据库从mysql转换为mongoDb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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