-
-
Save NielsMinssen/2be9d3c9f82e81622e1e349cb9d9f4ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
DB_NAME = "mabdd" #modifier | |
DB_USER = "Denis" #modifier | |
DB_PASS = "unmdpsécurisé" #modifier | |
DB_HOST = "le.server.de.denis.fr" #modifier | |
DB_PORT = "5432" #ne pas modifier, c'est le port PostgreSQL | |
try: | |
conn = psycopg2.connect(database=DB_NAME, | |
user=DB_USER, | |
password=DB_PASS, | |
host=DB_HOST, | |
port=DB_PORT) | |
print("Database connectée") | |
except: | |
print("Database non connectée") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment