Python Forum
Weird SQLAchemy connection string error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird SQLAchemy connection string error
#1
Hi all,

I have a piece of python code running flask with the following connection string and using SQLAchemy to connect to a MySQL DB running in Azure public cloud.

SQLALCHEMY_DATABASE_URI = 'mysql://username:[email protected]:3306/flaskdb'
Everything works fine if I run the python code on my local computer, I am able to access the MySQL database and it's contents. However, when I try to deploy the same code to an Azure Web App service, which is a PaaS platform for code deployment, I get the following error
Error:
2020-06-28T09:53:10.355423645Z: [ERROR] sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (9002, 'The connection string may not be right. Please visit portal for references.') 2020-06-28T09:53:10.355427245Z: [ERROR] (Background on this error at: http://sqlalche.me/e/e3q8)
I have been trying to troubleshoot by playing around with the connection string but to no avail. I do not think the connection string is incorrect as I don't encounter errors running it locally. Wonder if anyone who is familiar with this can provide me with some advice. Thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Virtual Env changing mysql connection string in python Fredesetes 0 383 Dec-20-2023, 04:06 PM
Last Post: Fredesetes
  Mysql error message: Lost connection to MySQL server during query tomtom 6 16,134 Feb-09-2022, 09:55 AM
Last Post: ibreeden
  Serial connection connection issue Joni_Engr 15 8,099 Aug-30-2021, 04:46 PM
Last Post: deanhystad
  Weird function defaults error? wallgraffiti 5 2,188 Aug-07-2020, 05:55 PM
Last Post: deanhystad
  Connection timed out error when connecting to SQL server kenwatts275 2 3,345 Jun-02-2020, 07:35 PM
Last Post: bowlofred
  Pyinstaller create this error :“File ”multiprocessing\connection.py“, line 691 Formationgrowthhacking 2 3,639 Apr-30-2020, 10:26 AM
Last Post: buran
  GutHub Connection Error sridhar 0 1,460 Apr-23-2020, 03:08 PM
Last Post: sridhar
  String coming up weird EddiesTech 1 1,532 Mar-15-2020, 05:02 PM
Last Post: buran
  connection string issue racone 2 3,739 Feb-03-2020, 02:22 AM
Last Post: racone
  [split] Python beginner: Weird Syntax Error mnsaathvika 1 2,144 Jul-22-2019, 06:14 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020