Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBALException: The options 'driver' or 'driverClass' are mandatory if no PDO instance is given to DriverManager::getConnection(). #2

Open
ghost opened this issue Jan 18, 2014 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 18, 2014

I followed your setup guide and got this error:

DBALException: The options 'driver' or 'driverClass' are mandatory if no PDO instance is given to DriverManager::getConnection().

My config.yml doctrine section:

doctrine:
    dbal:
        driver:   pdo_mysql
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%
        charset:  UTF8
@hubertperron
Copy link
Contributor

Which Symfony version are you using ?

@ghost
Copy link
Author

ghost commented Jan 20, 2014

2.3.9

@hubertperron
Copy link
Contributor

I'm having a hard time reproducing the issue.

Are you using multiple database connections and/or multiple entity managers?
Do the database connection work when you disable the DatabaseConfigBundle and the custom getContainerBuilder() method on the kernel ?

@ghost
Copy link
Author

ghost commented Jan 20, 2014

I´m working on a pretty new project with no mentionable changes and one connection. The connection works when I disable the bundle.

I hotfixed the problem by adding

$mergedConfig['dbal']['driver'] = 'pdo_mysql';

before the line

$params = $mergedConfig['dbal'];

in the initConnection function(ContainerBuilder.php).

@ibasaw
Copy link

ibasaw commented Dec 12, 2017

same problem here: Symfony 2.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants