clickhouse连接,感觉没使用我的连接字串 返回
从SqlSugar.ConnectionConfig可以看到正确的字串:ConnectionString: "host=192.168.1.124;port=8123;database=factor;user=test;password=zz1234"
但是报出的异常是
中文提示 : 连接数据库过程中发生错误,检查服务器是否正常连接字符串是否正确,错误信息:Code: 516. DB::Exception: default: Authentication failed: password is incorrect, or there is no user with such name.
If you have installed ClickHouse and forgot password you can reset it in the configuration file.
The password for default user is typically located at /etc/clickhouse-server/users.d/default-password.xml
and deleting this file will reset the password.
See also /etc/clickhouse-server/users.xml on the server where ClickHouse is installed.
. (AUTHENTICATION_FAILED) (version 24.10.2.80 (official build))
DbType="ClickHouse";ConfigId="".
English Message : Connection open error . Code: 516. DB::Exception: default: Authentication failed: password is incorrect, or there is no user with such name.
If you have installed ClickHouse and forgot password you can reset it in the configuration file.
The password for default user is typically located at /etc/clickhouse-server/users.d/default-password.xml
and deleting this file will reset the password.
See also /etc/clickhouse-server/users.xml on the server where ClickHouse is installed.
. (AUTHENTICATION_FAILED) (version 24.10.2.80 (official build))
DbType="ClickHouse";ConfigId=""
为什么给我的感觉是用的default用户在连接??我这个字串,在python上以及dbeaver均可以正常运行。是我字串有问题么?
热忱回答(6)
-
mike VIP02周前
这个是可以复现的,我使用官方的demo ClickHouseTest,测试多次,发现确实如此。
它读取了我的database,我的password,就是没读取我的user;
如果使用默认的default用户(我需要给default开远程,安全性有问题),就可以连接。
0 回复 -
fate sta VIP02周前
new ClickHouseConnection(ClickHouseConnectionString)。Open();
可以用原生测试
0 回复 -
mike VIP02周前
真的调到你们的内部类,才会知道为什么。。。被气死。
请更新你们的文档:
.NET中操作 ClickHouse .NET ORM - SqlSugar 5x - .NET果糖网
你们连接串里面,需要用的不是user,是username,不然反射失败
0 回复 -
mike VIP02周前
另外问一下,clickhouse里面的Map<string,string>类型,可以支持么?
0 回复 -
fate sta VIP02周前
@mike:你可以用字符串类型,看文档:json类型
0 回复 -
fate sta VIP02周前
存JSON来实现
0 回复