mystic cola
mystic cola

Reputation: 1643

Symfony 2 Project Receiving [PDOException] General Error: 2050

[PDOException] SQLSTATE[HY000]: General error: 2050

example:dbextra:install [--drop]

Database is setup properly, pdo is up and running, pdo_mysql is up and running, redis is up and running, elasticsearch is up and running...

If I look in my parameters.ini or I load the page and look under db in Symfony2 it tells me that everything is running fine. But I can't get dbextra:install to work and my app simply will not write to the database even though all the logs are saying that it IS writing to the database.

My app has a user name and password login and the ability to create new users. It correctly loads the forms and allows you to create a new user... but never actually writes that info to the database (even though it's saying it IS writing it to the database.)

Checked all the settings and all the servers are functioning normally (otherwise the app wouldn't run at all.)

The only error message I can get is that one.

Any ideas?

Upvotes: 0

Views: 270

Answers (1)

mystic cola
mystic cola

Reputation: 1643

Someone using Ubuntu with Symfony2 will ABSOLUTELY run into this problem. So I thought I´d take a moment to explain the solution.

Symfony2 requires PDO... and it requires MySQL... but you can get pretty damned far without actually having pdo_mysql. If you just have PDO and MySQL installed... your application will probably run... but it will never write to the database.

And if you do a search for PDO_MySQL Ubuntu... you'll find a lot of outdated links to old versions of pdo_mysql that won't function properly with MySQL 5.5.

The solution is to run:

apt-get install php5-mysql

And then just restart apache and that will get rid of the error.

Upvotes: 1

Related Questions