Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS cannot connect to MySQL if user's password contains commas. #54493

Closed
2 tasks done
kochizufan opened this issue Sep 5, 2023 · 5 comments · Fixed by #54573
Closed
2 tasks done

QGIS cannot connect to MySQL if user's password contains commas. #54493

kochizufan opened this issue Sep 5, 2023 · 5 comments · Fixed by #54573
Assignees
Labels
Authentication Related to the QGIS Authentication subsystem or user/password handling Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@kochizufan
Copy link

What is the bug or the crash?

When QGIS tries to connect to MySQL, the connection fails if the user's password contains commas.

Steps to reproduce the issue

  1. Create user at MySQL Server (I tried with MySQL 8.1.0)
  2. Make password of the user to contain commas.
  3. Create spatial table at MySQL.
  4. Try to connect from QGIS to MySQL through Layer > Data Source Manager
  5. Connection failed.

Versions

QGIS version
3.30.3-'s-Hertogenbosch
QGIS code revision
2411cec
Qt version
5.15.3
Python version
3.9.5
GDAL/OGR version
3.7.0
PROJ version
9.2.0
EPSG Registry database version
v10.082 (2023-02-06)
GEOS version
3.11.2-CAPI-1.17.2
SQLite version
3.41.1
PDAL version
2.5.3
PostgreSQL client version
unknown
SpatiaLite version
5.0.1
QWT version
6.1.6
QScintilla2 version
2.13.1
OS version
Windows 10 Version 2009

Active Python plugins
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

QGIS stores Connection string like
'MySQL:geo_test,host=localhost,port=3306,user=root,password=XXXXXXX'
So if password contains commas, password is splitted by comma.
<aybe this is the reason of this bug.

@kochizufan kochizufan added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Sep 5, 2023
@agiudiceandrea agiudiceandrea added the Authentication Related to the QGIS Authentication subsystem or user/password handling label Sep 5, 2023
@elpaso elpaso self-assigned this Sep 12, 2023
@elpaso
Copy link
Contributor

elpaso commented Sep 12, 2023

This is a GDAL issue

@elpaso elpaso added the Upstream Needs changes in an upstream library (like Qt, Proj, GDAL, ...) label Sep 12, 2023
@kochizufan
Copy link
Author

Thank you for clarifying, I'll report this to GDAL.

@kochizufan
Copy link
Author

Sorry I found this, thank you
OSGeo/gdal#8385

@elpaso
Copy link
Contributor

elpaso commented Sep 13, 2023

Let's leave this open: changes to QGIS are also required.

@elpaso elpaso removed the Upstream Needs changes in an upstream library (like Qt, Proj, GDAL, ...) label Sep 13, 2023
@elpaso
Copy link
Contributor

elpaso commented Sep 13, 2023

It turned out that it is a QGIS fault not quoting the username and password correctly when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authentication Related to the QGIS Authentication subsystem or user/password handling Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants