Skip to content
Snippets Groups Projects

Fixed sqlutils.py

Merged Ahmed El Shatshat requested to merge fix into main
1 file
+ 11
2
Compare changes
  • Side-by-side
  • Inline
+ 11
2
@@ -10,15 +10,24 @@ def connect():
host = os.environ['RDS_HOSTNAME']
user = os.environ['RDS_USERNAME']
password = os.environ['RDS_PASSWORD']
database = os.environ['RDS_DATABASE']
port = 3306
database = 'se464'
# Use Data
# Connect to database
conn = pymysql.connect(host=host, port=port, user=user, password=password, database=database)
conn = pymysql.connect(host=host, port=port, user=user, password=password)
cursor = conn.cursor();
cursor.execute(f'CREATE DATABASE IF NOT EXISTS {database}')
conn.select_db(database)
return conn
# try:
# if conn:
# print("Connected to MySQL database")
Loading