Connecting MindsDB with Clickhouse

I was going through documentation of MindsDB and wanted to try connecting MindsDB to clickhouse. But, the issue that I’m facing at the moment is that as soon as I start the connection using “python3 -m mindsdb --api-mysql”, the process stops at “Waiting for incoming connections…”.

My Python version is 3.8.5. Installed MindsDB using pip3 and the only changes that I have made are the clickhouse connection details as stated below, in the default config.json file that is generated.

“default_clickhouse”: {
“enabled”: true,
“host”: “Used the Clickhouse IP here”,
“password”: “Clickhouse password”,
“port”: 8123,
“type”: “clickhouse”,
“user”: “Clickhouse Username”

I have tried both the locally installed clickhouse and also clickhouse installed on a different server. There is no Firewall or connection issue to that server as I have already tested that.
Do I need to make any other changes in the config.json file to make it work?


1 Like

Hello @Varun and thanks for joining the forum. I think Waiting for incoming connections… is just logging info and you can ignore it. Did you get some errors after that? By looking at the config everything should work for you.

Hi @Zoran
Thank you for looking into it. I have yet to try using SQL Statements but as of now, as there doesn’t seem to be any errors, I have downloaded the MindsDB Scout and connected to the IP and it was working perfectly, Thanks!

I just have a question here. Under the ‘Predictors’ section of MindsDB Scout, I have clicked on Train New >> Advanced Mode and entered “4” under “Stop Training After (In minutes)” and started training on a particular column. The issue is that the Training status still shows 5 Hrs of training and kept going for more than 10 min. until I stopped manually, even when I gave 4 minutes. Is this a bug or is that how it is supposed to work?

1 Like

Also, after the model is trained, at the end, during “Model prediction and decoding completed”. I’m getting the following issue:

Could not load module ModelAnalyzer
RuntimeError: size mismatch, m1: [1 x 0], m2: [492 x 100] at /pytorch/aten/src/TH/generic/THTensorMath.cpp:41

ERROR:mindsdb-logger-ddd9304c-fe3b-11ea-bddc-06378074a2c9:MindsDB/Vmdb/lib/python3.8/site-packages/mindsdb_native/libs/controllers/ - size mismatch, m1: [1 x 0], m2: [492 x 100] at /pytorch/aten/src/TH/generic/THTensorMath.cpp:41

this doesn’t seem to be an issue at my end?

1 Like

Hello @Varun and thanks for the feedback again. To answer your first question Stop Training After (In minutes) should stop the training in your case after 4 minutes. I will check that and open the corresponding issue. About the second one, I guess it is an input mismatch but we will need data examples to reproduce this. Can you please share the dataset you are using if it is not a private or a short dump of the data?

Hello @Zoran,
Sure, the dataset I’m working on is the public Superstore dataset that can be found in this below link.

1 Like

Thanks @Varun, we will check this and get back to you with more info.

Hello @Varun, can you tell us which column did you try to predict?

Hi @paxcema, I’m trying to predict the ‘Sales’ column.


Hi @Varun, thanks to your help we have identified the issue and are actively working on this. We’ll let you know once it is fixed.

1 Like

Hello @Varun, I have a quick update: as of MindsDB Native 2.14, the SizeMismatch issue should be fixed. If you can, please upgrade MindsDB Native via pip and let us know if it works for you.

1 Like

@Varun Please, confirm if the latest version works for you.