Using MySQL but noticed that your Python scripts no longer able to retrieve data as usual?

If the following symptoms apply to you:

  • You recently migrated from Azure MariaDB to Azure MySQL.
  • MySQL Workbench is able to return data successfully.
  • You have not made any changes to your Python scripts, but they are no longer able to retrieve data as they did before the migration.

What you should do?
  • Please check if you are using mysql-connector as your library. If yes, please uninstall it by using this command:
    • pip uninstall mysql-connector -y
  • After that, please run this command to install the correct MySQL library for Python:
    • pip install mysql-connector-python

Some useful reference articles related to this issue: