doctrine / DoctrineBundle

Symfony Bundle for Doctrine ORM and DBAL
https://www.doctrine-project.org/projects/doctrine-bundle.html
MIT License
4.72k stars 453 forks source link

Symfony4 cannot create db if specify charset #747

Closed TangMonk closed 6 years ago

TangMonk commented 6 years ago

if .env file:

DATABASE_URL=mysql://root:root@127.0.0.1:3306/testd2?charset=UTF-8

after executing: $ bin/console doctrine:database:create, errors throw:

2017-12-06T02:12:23+00:00 [error] Error thrown while running command "doctrine:database:create". Message: "An exception occurred in driver: SQLSTATE[HY000] [2019] Unknown character set"

In AbstractMySQLDriver.php line 121:

  An exception occurred in driver: SQLSTATE[HY000] [2019] Unknown character set

In PDOConnection.php line 47:

  SQLSTATE[HY000] [2019] Unknown character set

In PDOConnection.php line 43:

  SQLSTATE[HY000] [2019] Unknown character set

if remove the charset option, it works fine

I am using the latest Symfony4 in command composer create-project symfony/skeleton

Ocramius commented 6 years ago

Closing as not reproducible. Please do open an issue only if it actually is proven to be an issue with the library.

kimhemsoe commented 6 years ago

Sounds to me that symfony overwrites charset with an empty string. This is only a guess tho.