469 Unstar Star 1.1K Fork 519

茹憶。 / Lepus

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
test_connect_mongodb.py 416 Bytes
Copy Edit Web IDE Raw Blame History
茹憶。 authored 2017-08-07 15:36 . 代码目录调整,修改readme
#!/usr/bin/python
#coding:utf-8
import os
import sys
import string
import pymongo
import random
host='219.234.6.180'
port=27017
user='tt_monitor'
passwd='tt_monitor'
dbname='admin'
try:
connect = pymongo.Connection(host,int(port))
db = connect[dbname]
db.authenticate(user,passwd)
print "MongoDB server connect success!"
except Exception, e:
print e
sys.exit(1)
finally:
sys.exit(1)

Comment ( 0 )

Sign in for post a comment

Python
1
https://git.oschina.net/ruzuojun/Lepus.git
git@git.oschina.net:ruzuojun/Lepus.git
ruzuojun
Lepus
Lepus
master

Search

132457 8cb2edc1 1899542 131848 70c8d3a4 1899542