【发布时间】:2022-10-21 21:52:56
【问题描述】:
我的数据库遇到问题。上下文:Web 应用程序引用成员,可以通过 xls 文件存储库导入成员,并进行处理以将其保存在数据库中。我尝试执行一个应该在生产环境的后台运行的命令,但在开发环境中它必须手动执行,以执行具有“要导入”状态的文件的导入。执行过程中出现问题,命令显示PDO有驱动问题,找不到。 知道问题可能来自哪里吗? 你会在这里找到详细的错误信息,以及 symfony 5 项目的 config.yml
In AbstractMySQLDriver.php line 128:
An exception occurred in driver: could not find driver
In Exception.php line 18:
could not find driver
In PDOConnection.php line 40:
could not find driver
doctrine:
dbal:
driver: pdo_mysql
host: '%database_host%'
port: '%database_port%'
dbname: '%database_name%'
user: '%database_user%'
password: '%database_password%'
charset: UTF8
types:
phone_number: Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType
server_version: "%doctrine_server_version%"
options:
1002: 'SET sql_mode=(SELECT REPLACE(@@sql_mode, "ONLY_FULL_GROUP_BY", ""))'
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
dql:
string_functions:
MONTH: DoctrineExtensions\Query\Mysql\Month
YEAR: DoctrineExtensions\Query\Mysql\Year
regexp: DoctrineExtensions\Query\Mysql\Regexp
replace: DoctrineExtensions\Query\Mysql\Replace
DATE_FORMAT: DoctrineExtensions\Query\Mysql\DateFormat
mappings:
gedmo_tree:
type: annotation
prefix: Gedmo\Tree\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity"
alias: GedmoTree # (optional) it will default to the name set for the mapping
is_bundle: false
【问题讨论】:
-
你能告诉我们你的 .env 文件吗?