Connect to the database
unknown
python
2 years ago
227 B
7
Indexable
def connect_db():
try:
con = psycopg2.connect(database="x", user="u1", password="p1", host="xxx.xxx.xxx", port="0")
return con
except:
print("An error occurred trying to connect to the database")Editor is loading...