Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
database-setup
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SE464 Fall 2023
database-setup
Merge requests
!1
Fixed sqlutils.py
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fixed sqlutils.py
fix
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Ahmed El Shatshat
requested to merge
fix
into
main
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
👍
0
👎
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
746ee3da
1 commit,
1 year ago
1 file
+
11
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
sqlutils.py
+
11
−
2
Options
@@ -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