Code Monkey home page Code Monkey logo

Comments (7)

silviokennecke avatar silviokennecke commented on June 30, 2024 2

@garak I had the same problem. According to the symfony documentation (https://symfony.com/doc/current/reference/configuration/doctrine.html) the configuration parameter url overrides some of the configuration. This seems to happen with driver_class, too.
Try the following config:

# doctrine.yaml
doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                server_version: '5.7'
                charset: utf8mb4
                default_table_options:
                    charset: utf8mb4
                    collate: utf8mb4_unicode_ci
                dbname: '%env(resolve:DATABASE_NAME)%'
                host: '%env(resolve:DATABASE_HOST)%'
                port: '%env(resolve:DATABASE_PORT)%'
                user: '%env(resolve:DATABASE_USER)%'
                password: '%env(resolve:DATABASE_PASSWORD)%'
                wrapper_class: 'Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connection'
                driver_class: 'Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDOMySql\Driver'
# .env
###> doctrine/doctrine-bundle ###
#DATABASE_URL=mysql://root:[email protected]:3306/dbname
DATABASE_NAME=dbname
DATABASE_HOST=127.0.0.1
DATABASE_PORT=3306
DATABASE_USER=root
DATABASE_PASSWORD=password
###< doctrine/doctrine-bundle ###

from doctrine-mysql-come-back.

taueres avatar taueres commented on June 30, 2024

Hi, thanks for opening this issue!

According to DBAL documentation:

The parameter driverClass specifies a custom driver implementation if no driver is specified. This allows the use of custom drivers that are not part of the Doctrine DBAL itself.

So the parameter driver has higher priority and will overwrite whatever is configured as driverClass.
Your configuration is declaring both parameters, please remove driver and the issue should be fixed.

from doctrine-mysql-come-back.

Jean85 avatar Jean85 commented on June 30, 2024

In reality, the docs of this lib states that you need to configure both; and in fact the error comes from this lib, requiring a connection that implements ServerGoneAwayExceptionsAwareInterface.

from doctrine-mysql-come-back.

peelandsee avatar peelandsee commented on June 30, 2024

@Jean85 are you sure?

what @taueres said seems pretty clear,
and the error comes from this lib because the wrapper class refuse a standard pdo_mysql driver implementation, missing that Interface.

@garak may you confirm your error was to declare driver: 'pdo_mysql'?

thanks,

from doctrine-mysql-come-back.

Jean85 avatar Jean85 commented on June 30, 2024

Oh sorry you're right, I misread @ŧaueres comment.

from doctrine-mysql-come-back.

peelandsee avatar peelandsee commented on June 30, 2024

@garak

would you like to update this?

have you tried @taueres suggestion in #30 (comment) or @silviokennecke in #30 (comment) ?

from doctrine-mysql-come-back.

garak avatar garak commented on June 30, 2024

Unfortunately, I gave up with this option and so I can't do any update.
I'm confident that suggested solutions are working, so feel free to close this issue.
Thank you all

from doctrine-mysql-come-back.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.