mysql database connection problem
lsc0301
HOBBYOP
a year ago
I am using fastapi and pymysql to connect to the mysql database deployed on railway. I get the MYSQL_URL environment variable through the os.getenv method, but the code deployment log keeps reporting errors. I checked that all environment variables are correct.
ⓘ Deployment information is only viewable by project members and Railway employees.
2 Replies
a year ago
Hello,
Looks like this was a configuration issue that you have since solved, so I will mark this as solved!
Best,
Brody
Status changed to Solved brody • about 1 year ago
afterlife7481
PRO
a year ago
mysql_url = os.getenv('MYSQL_URL')
SQLALCHEMY_DATABASE_URI = mysql_url.replace('mysql://', 'mysql+pymysql://')Status changed to Open Railway • 11 months ago