MYQSL:

phpadmin导出,前面加字段

 

MONGODB:

启动:
mkdir -p /home/qygame/data
/usr/local/mongodb/bin/mongod -dbpath=/home/data/

备份:
/usr/local/mongodb/bin/mongodump -h 172.16.10.221 -d mmo

恢复:
/usr/local/mongodb/bin/mongorestore
[root@dns2 ~]# /usr/local/mongodb/bin/mongorestore
connected to: 127.0.0.1
Thu Jan 17 11:21:39 dump/mmo/league_rela.bson
Thu Jan 17 11:21:39      going into namespace [mmo.league_rela]
Thu Jan 17 11:21:39      1 objects found
Thu Jan 17 11:21:39 dump/mmo/social.bson
。。。。。

查看:
[root@dns2 ~]# /usr/local/mongodb/bin/mongo
MongoDB shell version: 1.6.2
connecting to: test
> show dbs
admin
local
mmo

 

db.t_passport.remove()
db.t_passport.find()

 

导入csv
/usr/local/mongodb/bin/mongoimport -d mmo -c t_passport --type csv --headerline --file t_passport.csv

--type文件格式
--headerline第一行不导入
--file文件路径

10-28 17:33