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.

28 lines
956 B
Python

11 months ago
import mysql.connector
altpins_username = "xantorn"
altpins_password = "AVNS_lGiLOVTTyGMtoOoRn5Q"
altpins_host = "archivebate-db-do-user-13308724-0.b.db.ondigitalocean.com"
altpins_port = 25060
altpins_database = "altpins"
altpins_sslmode = "REQUIRED"
def altpins_gen_connection():
print("Connecting to database")
newDB = mysql.connector.connect(host=altpins_host, user=altpins_username, password=altpins_password, database=altpins_database, port=altpins_port)
print("Connected to database")
return newDB, newDB.cursor()
username = "doadmin"
password = "AVNS_KNXK1IjScgTCe09gI9F"
host = "storysave-do-user-13308724-0.c.db.ondigitalocean.com"
port = 25060
database = "storysave"
sslmode = "REQUIRED"
def gen_connection():
print("Connecting to database")
newDB = mysql.connector.connect(host=host, user=username, password=password, database=database, port=port)
print("Connected to database")
return newDB, newDB.cursor()