Skip to content

Commit

Permalink
changed mysql_host
Browse files Browse the repository at this point in the history
  • Loading branch information
justanotherinternetguy committed Nov 17, 2024
1 parent 51158cc commit 124c357
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
3 changes: 1 addition & 2 deletions app/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def init_app(app):
def get_conn_info():
return {
'user' : current_app.config["MYSQL_USER"],
# 'host' : current_app.config["MYSQL_HOST"],
'host' : "mysql",
'host' : current_app.config["MYSQL_HOST"],
'password' : current_app.config["MYSQL_PASSWORD"],
'database' : current_app.config['DATABASE']
}
Expand Down
2 changes: 1 addition & 1 deletion config/default.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"SECRET_KEY": "ahhhhhhhhhh",

"MYSQL_HOST": "127.0.0.1",
"MYSQL_HOST": "mysql",
"MYSQL_USER": "user",
"MYSQL_PASSWORD": null,
"DATABASE": "wikipedia_speedruns",
Expand Down
8 changes: 0 additions & 8 deletions scripts/create_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,11 @@ def create_database(db_name, recreate=False, test_config=None):
if test_config:
config.update(test_config)

"""
conn = pymysql.connect(
user=config["MYSQL_USER"],
host=config["MYSQL_HOST"],
password=config["MYSQL_PASSWORD"],
)
"""

conn = pymysql.connect(
user=config["MYSQL_USER"],
host="mysql", # Use the MySQL service name here
password=config["MYSQL_PASSWORD"],
)


with conn.cursor() as cursor:
Expand Down

0 comments on commit 124c357

Please sign in to comment.