In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to solve the error report of python connection clickhouse port". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Python connection clickhouse Port problem 8123 9000
Notice that two ports, 8123 and 9000, can be used to receive http and tcp protocols, respectively.
If you connect with jdbc, the port is 8123
If you connect with driver, the port is 9000
From clickhouse_driver import Clientclient = Client (host=host, port=port, user=user, password=password, database='default') client = get_client () client.execute ("show tables;") print (client.execute ("select * from test_arr")) client.disconnect ()
At this point, if you use port 8123, you will get the following error:
Clickhouse_driver.errors.UnexpectedPacketFromServerError: Code: 102. Unexpected packet from server 192.168.137.101 Unexpected packet from server 8123 (expected Hello or Exception, got Unknown packet)
Report an error to clickhouse
Clickhouse_driver.errors.UnexpectedPacketFromServerError: Code: 102
Today, use python to write an etl to synchronize data from mysql to clickhouse. The amount of data is less than 10 million, leading to the error above for a while. Then looked it up on the Internet: found that the document was clearly written:
Welcome to clickhouse-driver-clickhouse-driver 0.2.4 documentation
Originally, clickhouse provided two ports: 8123 and 9000.
Port 9000 is required to use native protocal, and then the port is modified successfully.
This is the end of the content of "how to solve the error report of python connection clickhouse port". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.