新网创想网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
#!/usr/bin/env python
#coding:utf-8
from pymongo import MongoClient
client = MongoClient('192.168.6.243', 27017)
db=client['admin']
db.authenticate('root','123456')
#help(db) #查看python操作MongoDB的方法
for i in range(2,900):
try:
db = client['s%s' % i]
db.command("dropUser", "Tany")
db.command("dropDatabase")
except:
print 'not db'