connector-x
connector-x copied to clipboard
Error "Unknown authentication protocol: sha256_password" for queries to ClickHouse
What language are you using?
Python
What version are you using?
0.3.1
What database are you using?
ClickHouse (over MySQL protocol)
What dataframe are you using?
Polars
What are the steps to reproduce the behavior?
- Create a user identified with sha256_password in ClickHouse: https://clickhouse.com/docs/en/sql-reference/statements/create/user/
- Try to run any query using connectorx
Example query / code
import connectorx
import polars
conn = f'mysql://{user}:{password}@{host}:9004/default'
-- both queries fail with the same error
polars.read_sql('select 1 as c', conn, protocol='text')
connectorx.read_sql(conn, 'select 1 as c', protocol='text')
What is the error?
RuntimeError: timed out waiting for connection: DriverError { Unknown authentication protocol:
sha256_password
}
I also met with this issue
Hi, have you tried to urlencode your password? This may similar to this upstream issue
@wangxiaoying no, this is not my case
Hi, have you tried to urlencode your password? This may similar to this upstream issue
I've tried to encode with urllib.parse.quote_plus
. Didn't help.
I've just tried the same with user with plain password and it worked. So that means that connector-x doesn't work for users with sha256 password.
But console mysql client can connect to clickhouse with sha256 password. Maybe it can be done in connector-x as well?
I've just tested. Pandas through native clickhouse protocol is x2 faster than connector-x through mysql protocol. So it's not worth it anyway.
And it's faster to read with pandas and convert to polars than read directly to polars with connector-x through mysql protocol.
This issue still exists. Facing same issue