FriendsOfDoctrine / dbal-clickhouse

Doctrine DBAL driver for ClickHouse database
GNU General Public License v3.0
98 stars 80 forks source link

The connection example in the readme does not work #62

Open maluramichael opened 4 months ago

maluramichael commented 4 months ago

I tried the symfony example in the readme and only get http errors from clickhouse. I created a trial account on their page, got the credentials and enabled the mysql interface. Their example works fine in the terminal.

mysql -h MY_INSTANCE.eu-central-1.aws.clickhouse.cloud -u MY_USER -P 3306 --password

But no matter what i set in my doctrine.yml file i get errors like this

Could not create database `myproject` for connection named default
An exception occurred while executing 'CREATE DATABASE `myproject`':

Received HTTP/0.9 when not allowed```

The port 8123 you provided in the readme also does not work.

In DBALException.php line 185:

An exception occurred while executing 'SELECT database, name FROM system.tables WHERE database != 'system' AND engine != 'View'':

An exception occurred while executing 'SELECT database, name FROM system.tables WHERE database != 'system' AND engine != 'View'':

Failed to connect to MY_INSTANCE.eu-central-1.aws.clickhouse.cloud port 8123 after 5004 ms: Timeout was reached


My config looks like this.

```yaml
doctrine:
    dbal:
        host:          MY_INSTANCE.eu-central-1.aws.clickhouse.cloud
        port:          3306
        user:          default
        password:      "MY_PASSWORD"
        dbname:        myproject
        driver_class:  FOD\DBALClickHouse\Driver
        wrapper_class: FOD\DBALClickHouse\Connection
        options:
            enable_http_compression: 1
            max_execution_time:      60

And i get this error


bin/console doctrine:schema:update --dump-sql --complete --force

In DBALException.php line 185:

  An exception occurred while executing 'SELECT database, name FROM system.tables WHERE database != 'system' AND engine != 'View'':

  An exception occurred while executing 'SELECT database, name FROM system.tables WHERE database != 'system' AND engine != 'View'':

  Received HTTP/0.9 when not allowed

In DBALException.php line 185:

  An exception occurred while executing 'SELECT database, name FROM system.tables WHERE database != 'system' AND engine != 'View'':

  Received HTTP/0.9 when not allowed

In Statement.php line 190:

  Received HTTP/0.9 when not allowed

doctrine:schema:update [--em EM] [--complete] [--dump-sql] [-f|--force]```