File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1313db_user = os .environ .get ('DRAW_local_db_user' )
1414db_passwd = os .environ .get ('DRAW_local_db_pass' )
1515db_name = os .environ .get ('DRAW_local_db_name' )
16- #db_name="climate_test"
17- #db_name="climatedatarescueprocessed"
16+ db_host = os . environ . get ( 'DRAW_db_host' )
17+
1818# connection to copy of database on local machine
1919conn = mysql .connector .connect (
2020 ##### FOLLOWING 3 VARIABLES TO BE CONFIGURED AS NECESSARY FOR LOCAL MACHINE: #####
2121 user = db_user ,
2222 password = db_passwd ,
2323 database = db_name ,
24- host = 'localhost'
24+ host = db_host
2525)
2626
2727cursor = conn .cursor ()
2828
29- url = "mysql+mysqlconnector://" + db_user + ":" + db_passwd + "@localhost/" + db_name
30- #url = "mysql+mysqlconnector://"+'user'+":"+'password'+"@localhost/climatedatarescue"
29+ url = "mysql+mysqlconnector://" + db_user + ":" + db_passwd + "@l" + db_host + "/" + db_name
3130engine = sqlalchemy .create_engine (url )
3231
3332
You can’t perform that action at this time.
0 commit comments