mirror of https://github.com/sgoudham/Enso-Bot.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
509 B
Python
26 lines
509 B
Python
import sys
|
|
|
|
import mariadb
|
|
from decouple import config
|
|
|
|
password = config('DB_PASS')
|
|
|
|
|
|
def connection():
|
|
# Connect to MariaDB Platform
|
|
try:
|
|
conn = mariadb.connect(
|
|
user="hamothy",
|
|
password=password,
|
|
host="173.208.202.20",
|
|
port=3306,
|
|
database="enso"
|
|
)
|
|
if conn:
|
|
print("working")
|
|
except mariadb.Error as e:
|
|
print(f"Error connecting to MariaDB Platform: {e}")
|
|
sys.exit(1)
|
|
|
|
return conn
|