Problem Description: if you want to restrict specific IP addresses from accessing the Clickhouse, use the following statement to create a user
drop user test;
CREATE USER test HOST IP '172.18.xxx.xxx' IDENTIFIED WITH sha256_password BY 'test';
GRANT SHOW, SELECT, INSERT ON test.* TO test;
Client login:
ensure that the user name and password entered are correct
clickhouse-client --host 172.18.xxx.xxx --port 9000 --user test --password test -m
Error Messages:
Received from 172.18.xxx.xxx:9000. DB::Exception: test: Authentication failed:
password is incorrect or there is no user with such name.
ClickHouse client version 21.4.6.55 (official build).
Connecting to 172.18.52.122:9000 as user test.
Code: 516. DB::Exception:
Received from 172.18.xxx.xxx:9000. DB::Exception: test: Authentication failed:
password is incorrect or there is no user with such name.
Problem solving process:
1. Telnet database is accessible
telnet 172.18.xxx.xxx 9000
2. The database can be accessed normally when the user does not specify IP
drop user test;
CREATE USER test IDENTIFIED WITH sha256_ password BY ‘test’;
GRANT SHOW, SELECT, INSERT ON test.* TO test;
The user name and password are correct, and the network is connected. Why can’t you access normally after specifying the IP
the first thought is to look at the Clickhouse log, but no valuable information can be found by querying the Clickhouse log
where else can you provide useful information?Cilckhouse’s query_ The log appears
3. View query_ Log, initial_ Address is not the IP address of the client, but the address of the gateway
select initial_ address n from system
.query_ Log QL where user = “test”
why is the address of the gateway?It turns out that the client and Clickhouse are not in the same network segment. Access across network segments must pass through the gateway.
4. After changing the authorized IP address to the gateway, it can be accessed normally
in this way, the meaning of restricting IP addresses from accessing Clickhouse is lost.
Read More:
- Mongodb error: authentication failed [How to Solve]
- [Solved] dbeaver Connect clickhouse Error: Unexpected driver error occurred while connecting to the database
- [Solved] error: password authentication failed for user “postgres”
- Mysql5.7.18.1 Error 1054 (42S22): Unknown Column’password’ In’field List’ When Changing User Password
- [Solved] ClickHouse Start Error: Run under ‘sudo -u clickhouse‘
- How to Solve Clickhouse restart error: Cannot obtain value of path from config file…
- [Solved] Clickhouse Error: DB::Exception: Cannot lock file /var/lib/clickhouse/status
- [Solved] lightdb oracle_fdw Error: ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment handle
- [Solved] docker Error: bridge docker0 failed: exchange full
- Support for password authentication was removed on August 13, 2021
- [Solved] Jmeter Connect Database Error: Cannot create PoolableConnectionFactory
- [Solved] C# Access Mongodb Database Error: command find failed: Command find requires authentication
- [Solved] Canal 1.1.5 Startup Error: caching_sha2_password Auth failed
- Redis Error: (error) NOAUTH Authentication required. [How to Solve]
- [Solved] MariaDB Add Datas Error: SQL error [1366] [22007]: (cIncorrect string value: ‘\xE5\xBC\xA0\xE4\xB8\x89’ for column
- [Solved] @webservice Error: org.apache.cxf.common.i18n.UncheckedException: No operation was found with
- Tomcat: “localhost:8080” Error 401: Unauthorized
- [Solved] Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050
- Creating test database for alias ‘postgres’… Got an error creating the test database: permission
- [Solved] Elasticsearch Error: received plaintext http traffic on an https channel, closing connection…