Connect to the database
Anonymous
python
08/09/2023 2:20 PM
304 B
15
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...