啥也没写
分类: 系统运维
2013-01-17 11:54:40
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文件路径