Skip to content
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

Sessions and default database support in MySQL wire protocol #5646

Merged
merged 1 commit into from Jun 16, 2019

Conversation

yurriy
Copy link
Contributor

@yurriy yurriy commented Jun 16, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Category (leave one):

  • Improvement

Short description (up to few sentences):
Creating a new session in each MySQL connection. Using default database from config.xml, if it is not specified by client. #5476

Copy link
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! PS. Did you check (manually) that the user settings (e. g. max_memory_usage specified in users.xml) work?

@yurriy
Copy link
Contributor Author

yurriy commented Jun 16, 2019

Great! PS. Did you check (manually) that the user settings (e. g. max_memory_usage specified in users.xml) work?

No, the last thing to do from #5476 is implementing user settings. I was going to make them separately.

@alexey-milovidov alexey-milovidov merged commit 9679e30 into ClickHouse:master Jun 16, 2019
@alexey-milovidov
Copy link
Member

If I remember correctly, setUser will be enough?

@yurriy
Copy link
Contributor Author

yurriy commented Jun 17, 2019

If I remember correctly, setUser will be enough?

Also replacing strings by PODArray, which uses MemoryTracker.

@nshah14285
Copy link

I have installed clickhouse 19.10.1.688 version. As per project requirement, I have to connect to clickhouse database from MYSQL client, so I tried below command

mysql --protocol tcp -h localhost -P 9000 -u default --password -e "CREATE DATABASE x;"

and

mysql --protocol tcp -h localhost -P 9000 default -u default --password -e "CREATE DATABASE x;"

and also tried to connect from node application but it gets hang and after some time receive below error

653008 [ 41 ] {} ServerErrorHandler: Code: 209, e.displayText() = DB::NetException: Timeout exceeded while reading from socket (127.0.0.1:47000), Stack trace:

Could you please tell how to connect.

Thanks,
Nishit Shah

@yurriy
Copy link
Contributor Author

yurriy commented Jun 19, 2019

I have installed clickhouse 19.10.1.688 version. As per project requirement, I have to connect to clickhouse database from MYSQL client, so I tried below command

mysql --protocol tcp -h localhost -P 9000 -u default --password -e "CREATE DATABASE x;"

and

mysql --protocol tcp -h localhost -P 9000 default -u default --password -e "CREATE DATABASE x;"

and also tried to connect from node application but it gets hang and after some time receive below error

653008 [ 41 ] {} ServerErrorHandler: Code: 209, e.displayText() = DB::NetException: Timeout exceeded while reading from socket (127.0.0.1:47000), Stack trace:

Could you please tell how to connect.

Thanks,
Nishit Shah

Probably you are trying to connect to a native protocol server, which listens 9000 port by default. To be able to connect using mysql, you should add <mysql_port>9004</mysql_port> to config.xml.

@nshah14285
Copy link

Thanks.
It's working now.

@nshah14285
Copy link

I am able to connect ClickHouse from mysql client but when I tried to connect from node application using MYSQL module it throws an error

max_packet_size: 0
character_set: !
user: default
auth_response length: 20
auth_response: ;t#3
�O1�cf�k�Xkva�
database: test
auth_plugin_name:
2019.06.20 13:32:35.000536 [ 41 ] {} MySQLHandler: DB::Exception: Required capability: CLIENT_PLUGIN_AUTH.

Thanks

@yurriy
Copy link
Contributor Author

yurriy commented Jun 20, 2019

I am able to connect ClickHouse from mysql client but when I tried to connect from node application using MYSQL module it throws an error

MYSQL library does not support authentication plugins other than mysql_native_password, which makes it impossible to use it with ClickHouse now. We will add tests for this client when either this or this is merged.

@4ertus2 4ertus2 added the pr-improvement Pull request with some product improvements label Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants