Bonjour,
Pour l'instant je crée mes entités à la main. Ca fonctionne.
Là, j'ai pas mal de tables à partir desquelles je dois créer des entités.
Je gagnerais un temps fou en les générant via Doctrine mais en ligne de commande j'ai une erreur de connection à la bdd.
Pourtant, mes entités créées manuellement écrivent et lisent bien en bdd.
Mon projet tourne avec Zend Framework 2.
J'utilise gitBash, je me place dans mon projet, et je lance:
./vendor/doctrine/doctrine-module/bin/doctrine-module orm:convert-mapping --namespace="Album\\Entity\\" --force --from-database --filter="album" annotation ./module/Album/src/
J'ai une erreur:
Fatal error: Uncaught exception 'PDOException' with message ' in Z:\monprojet\vendor\zendframework\zend-servicemanager\src\ServiceManager.php on line 943
PDOException: SQLSTATE[HY000] [2002] Aucune connexion n▒a pu ▒tre ▒tablie car l▒ordinateur cible l▒a express▒ment refus▒e.
in Z:\monprojet\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php on line 43
Pourtant je me connecte bien à ma bdd dans mon appli Zend et tout fonctionne. Mes infos de connexion se trouvent dans Z:\monprojet\config\autoload\doctrine.global.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <?php
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' =>'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => '127.0.0.1',
'port' => '3313',
'user' => '***',
'password' => '***********',
'dbname' => '**********',
'charset' => 'utf8',
'driverOptions' => array (1002 => 'SET NAMES utf8', 1000 => true),
)
)
)
)
); |
Je vous remercie pour votre aide
.
Partager