我是Symfony的初学者。我一步一步地跟着书,在关于DoctrineFixturesBundle的节选中,我遇到了这个问题。
这一节目单的步骤包括:
诸若此类。我坚持第4点。命令生成:原则:实体导致三条消息,而没有在我的项目中创建任何实体。
三条信息
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [1049] Base 'symfony' incon
nue
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [1049] Base 'symfony' inconnue
[PDOException]
SQLSTATE[HY000] [1049] Base 'symfony' inconnue我在控制台中所做的一切如下:
C:\wamp\www\17CHUJNIA>php app/console generate:bundle
Welcome to the Symfony2 bundle generator
.
.
.
Bundle name [MyTestBundle]:
.
.
.
Bundle generation
Generating the bundle code: OK
Checking that the bundle is autoloaded: OK
Confirm automatic update of your Kernel [yes]?
Enabling the bundle inside the Kernel: OK
Confirm automatic update of the Routing [yes]?
Importing the bundle routing resource: OK
You can now start using the generated code!
C:\wamp\www\17CHUJNIA>php app/console generate:doctrine:entity
Welcome to the Doctrine2 entity generator
The Entity shortcut name: MyTestBundle:Name
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [1049] Base 'symfony' incon
nue
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [1049] Base 'symfony' inconnue
[PDOException]
SQLSTATE[HY000] [1049] Base 'symfony' inconnue
doctrine:generate:entity [--entity="..."] [--fields="..."] [--format="..."] [--with-repository]
C:\wamp\www\17CHUJNIA>发布于 2015-01-06 21:40:14
您需要有一个现有的数据库和一个有效的连接才能使用此命令行。在使用处理数据库和实体的命令行之前,检查/app/config/parameters.yml文件并创建数据库。
https://stackoverflow.com/questions/27807374
复制相似问题