12 lines
274 B
Python
12 lines
274 B
Python
import mysql.connector, os
|
|
cnx = mysql.connector.connect(
|
|
host=os.getenv("DB_HOST"),
|
|
port=int(os.getenv("DB_PORT", "3306")),
|
|
user=os.getenv("DB_USER"),
|
|
password=os.getenv("DB_PASS"),
|
|
database=os.getenv("DB_NAME"),
|
|
)
|
|
print("OK, connecté !")
|
|
cnx.close()
|
|
|