Comments (5)
DBeaver has native ClickHouse support via the official JDBC driver — why would you use the MySQL interface for that? The same is true for DataGrip.
Regarding the intended use case, our primary focus was on the (proprietary) BI tools that don't have a native plugin or driver, such as:
- Looker Studio
- Tableau Online
- QuickSight
When possible, using native drivers is always preferred.
from clickhouse.
Please provide the full reproducer (the whole Go program) and step-by-step guidance how to get this error. This will simplify the work for developers and increase chances for it to be fixed quickly.
from clickhouse.
ch-test.zip
attached sample Go program
Just run it in debugger and see the error when query "select 1" is run
from clickhouse.
The MySQL interface is mainly for specific tools that don't have native ClickHouse support yet. We also have the official ClickHouse Go driver available (clickhouse-go).
In any case, if you grab the Let's Encrypt root cert, the following will work:
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"database/sql"
"fmt"
"log"
"os"
"github.com/go-sql-driver/mysql"
)
func main() {
ctx := context.Background()
rootCertPool := x509.NewCertPool()
pem, err := os.ReadFile("./isrgrootx1.pem")
if err != nil {
panic(err)
}
if ok := rootCertPool.AppendCertsFromPEM(pem); !ok {
log.Fatal("Failed to append PEM.")
}
err = mysql.RegisterTLSConfig("custom", &tls.Config{
ServerName: "<service>.clickhouse.cloud",
RootCAs: rootCertPool,
})
if err != nil {
panic(err)
}
db, err := sql.Open("mysql", "<username>:<password>@tcp(<service>.clickhouse.cloud:3306)/default?tls=custom")
if err != nil {
panic(err)
}
conn, _ := db.Conn(ctx)
var result string
err = conn.QueryRowContext(ctx, `SELECT version() AS result`).Scan(&result)
if err != nil {
panic(err)
}
fmt.Printf("result: %s\n", result)
}
Which prints the correct result for my test instance:
result: 24.1.2.10900
Don't forget to allow the instance access for your IP address; otherwise, you might encounter the same EOF error again.
from clickhouse.
Hi guys
I thought that ClickHouse MySQL interface was intended to allow existing apps which use MySQL to use ClickHouse as drop-in replacement - just switch to new address, assuming that table structures are the same and SQL queries are compatible.
That is not the case?
ClickHouse documentation says:
"ClickHouse supports the MySQL wire protocol. This allow tools that are MySQL-compatible to interact with ClickHouse seamlessly"
I thought that means all apps which use MySQL? If that is not the case, please clarify.
Also, another example, I cannot connect to ClickHouse's MySQL port using DBeaver in same way as I connect to real MySQL database - is that expected behavior?
Thanks!
from clickhouse.
Related Issues (20)
- Alias column in subquery for `IN` is not expanded before skip index analysis HOT 2
- Improve the performance of `rb_contain` of 32-bit Bitmap
- OOM are prone to occur in window functions HOT 1
- The Recursive CTEs for generating Fibonacci Sequence produce wrong rows after n > 10. HOT 1
- There is a bug in decimal data comparison HOT 2
- Decimal
- Code: 241. DB::Exception: Memory limit (total) exceeded
- Code: 241. DB::Exception: Memory limit (total) exceeded HOT 1
- I need an unexpected set of privileges when inserting into the first source table in cascading materialized view HOT 1
- Unable to restore backups of tables with Object('json') column HOT 2
- Flaky / stuck: 02864_statistics_uniq HOT 1
- Wrong downcast from 'const DB::ColumnVector<UInt64>' to 'DB::ColumnLowCardinality' HOT 2
- Unexpected S3 reconciliation after a minor upgrade is causing high outgoing bandwidth usage, resource exhaustion HOT 2
- Optimize injective functions with several arguments inside of Uniq functions
- Apply LIMIT in GROUP BY
- S3Queue Log Status Ignores Failed Downstream Materialized Views HOT 4
- min_bytes_to_use_direct_io > 0 can lead to "Cannot read all array values" or even segfault HOT 5
- A new function `sparseGrams`
- `clickhouse-local` should have `max_memory_usage` by default
- If the configuration file is not `.xml`, `.yml` or `.yaml`, autodetect its format. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse.