While testing #1150, @cmadjar encountered an issue when connecting to the database through SQLAlchemy. I suspect this is because this connection is using a deprecated version of mysql-connector. This dependency was already present in LORIS-MRI before adding SQLAlchemy although it was unused, and I wrongfully used it for the SQLAlchemy connection not knowing the version we had was deprecated (the non-depecrated version is mysql-connector-python.).
Solution: Remove the mysql-connector dependency and use mysqlclient instead, which is the client we use for the non-SQLAlchemy database connection.
P.S. 1: I manually recreated my virtual environment to make sure the dependency was completely removed, but it was detected by git, so I added the directory the gitignore, I have no idea why it was ignored before.
P.S. 2 : Some whitespace auto-trimming, ignore whitespaces in review.
P.S. 3 : Added quote() to escape the username and password of the use (the database and host should not have special characters).
Notes for existing projects
Need to remove mysql-connector via pip uninstall mysql-connector
While testing #1150, @cmadjar encountered an issue when connecting to the database through SQLAlchemy. I suspect this is because this connection is using a deprecated version of
mysql-connector
. This dependency was already present in LORIS-MRI before adding SQLAlchemy although it was unused, and I wrongfully used it for the SQLAlchemy connection not knowing the version we had was deprecated (the non-depecrated version ismysql-connector-python
.).Solution: Remove the
mysql-connector
dependency and usemysqlclient
instead, which is the client we use for the non-SQLAlchemy database connection.P.S. 1: I manually recreated my virtual environment to make sure the dependency was completely removed, but it was detected by git, so I added the directory the gitignore, I have no idea why it was ignored before.
P.S. 2 : Some whitespace auto-trimming, ignore whitespaces in review.
P.S. 3 : Added
quote()
to escape the username and password of the use (the database and host should not have special characters).Notes for existing projects
mysql-connector
viapip uninstall mysql-connector