Comments (7)
@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.
Hi, thanks for opening this issue!
According to DBAL documentation:
The parameter
driverClass
specifies a custom driver implementation if nodriver
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.
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.
@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.
Oh sorry you're right, I misread @ŧaueres comment.
from doctrine-mysql-come-back.
would you like to update this?
have you tried @taueres suggestion in #30 (comment) or @silviokennecke in #30 (comment) ?
from doctrine-mysql-come-back.
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)
- Changelog missing HOT 1
- need add goneAwayExceptions HOT 7
- doctrine/dbal 2.7 support HOT 3
- Handle "Connection timed out" HOT 1
- Statement object looses state of statement HOT 2
- ReflectionException: Property _transactionNestingLevel does not exist HOT 3
- Deprecation warning HOT 6
- Undefined method named fetchAllAssociative HOT 6
- Php8 HOT 1
- Usage of PrimaryReadReplicaConnection is failing HOT 3
- Missing functions HOT 4
- PHP 7.1 compatibility HOT 2
- Installation of version 2.x is not working HOT 10
- Configuration no longer applies when using DoctrineBundle 2.6.3 and newer when replicas configured HOT 4
- Timeouts despite the configuration is set according to the recommendation HOT 4
- No reconnect on "START TRANSACTION" HOT 3
- Migration to v2 HOT 5
- Add PrimaryReadReplicaConnetion again in v2 (or offer alternative) HOT 2
- Logger integration for better documentation HOT 3
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 doctrine-mysql-come-back.