-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
using http mode, connecting database failed when account password ends with @ #313
Comments
if password contains the @ symbol, it needs to be URL-encoded to ensure the URI parser correctly interprets the components of the string. URL encoding converts the @ symbol to %40. For instance, if the password is pass@word, you should write the connection string as follows:
|
Thank you for the solution.
|
Describe the bug
Raise error clickhouse_sqlalchemy.exceptions.DatabaseException: Orig exception: Code: 516. DB::Exception: default: Authentication failed: password is incorrect or there is no user with such name. (AUTHENTICATION_FAILED) (version xxx)
To Reproduce
try code as above, can reproduce this issue 100%
Compare with password not end with @, can connect successully.
Plus, use tcp mode: uri = "{}://{}:{}@{}:{}/{}".format('clickhouse+native', chuser, chpwd, chhost, 9000, dbname) can also connect successully.
Maybe with http mode, password end with @, when processing, cut string wrong when uri like clickhouse://default:chpwd123@@chhost:8123/db1 with 2@
It's possible that password contains @ (like chpwd@123, @chpwd123) exists same problem, I didn't take extra try.
Expected behavior
Can connect database successfully.
Versions
Python: 3.9.11
clickhouse-sqlalchemy: 0.2.3
SQLAlchemy: 1.4.49
SQLAlchemy-Utils: 0.41.1
clickhouse-driver: 0.2.7
The text was updated successfully, but these errors were encountered: