学说-cli 的问题
我在从 YAML 文件构建数据库时遇到问题。
这是错误:
./scripts/doctrine-cli build-all-load
build-all-load - Generated models successfully from YAML schema
build-all-load - Couldn't locate driver named mysql
build-all-load - Created tables successfully
build-all-load - Data was successfully loaded
它构建了我的模型,但数据库中没有任何内容。我正在使用 MAMP,并且已检查并且 pdo_mysql 正在运行。我不完全确定为什么会发生这种情况。谢谢。
I am having issues getting my database to build from my YAML file.
Here is the error:
./scripts/doctrine-cli build-all-load
build-all-load - Generated models successfully from YAML schema
build-all-load - Couldn't locate driver named mysql
build-all-load - Created tables successfully
build-all-load - Data was successfully loaded
It builds my models, but nothing in the database. I am using MAMP and I have checked and pdo_mysql is running. I am not completely sure why this would happen. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来很像
pdo_mysql
没有启用;你说你检查了php.ini
,但是你检查了从命令行运行PHP时使用的那个吗?(这通常与 PHP 作为 Apache 模块运行时使用的不同)
您可以使用 php -m 获取已加载扩展的列表:
并且从 CLI 运行 PHP 时,php -i 应该指示使用哪个 .ini 文件:
This quite looks like
pdo_mysql
is not enabled ; you said you checkedphp.ini
, but did you check the one that's used when PHP is run from the command line ?(That's often not the same as the one used when PHP is run as an Apache module)
You can use
php -m
to get the list of loaded extensions :And
php -i
should indicate which .ini file is used, when running PHP from the CLI :