驱动程序发生异常:找不到驱动程序

问题描述

我使用的是 Mac,我已经下载了 Visual Studio Code 和 Mamp。我安装了 Symfony。我没有安装任何其他东西,在我看来我必须安装 MysqL ?我以为我不需要它,因为我一直在通过 Mamp 使用 MysqL,但在另一篇文章中我明白我应该这样做吗?

现在,在 Symfony 上,我尝试使用

创建数据库
doctrine:database:create 

我收到一个错误

An exception occurred in driver: Could not find driver

在另一篇文章之后,我检查了 PHPinfo() 并且我确实启用了 PDO MysqL。但它没有出现在我的 PHP.ini 中(当我去 Mamp->bin->PHP->PHP7.4.9->conf->PHP.ini 时)。我读过我应该看到 extension=PHP_MysqLi.soPHP_pdo_pgsql.soPHP_pdo_MysqL.so

我需要自己添加吗?

更新:PHP bin/console debug:config 准则的结果:

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver: pdo_MysqL
                server_version: '5.7'
                charset: utf8mb4
                default_table_options:
                    charset: utf8mb4
                    collate: utf8mb4_unicode_ci
                url: '%env(resolve:DATABASE_URL)%'
                host: localhost
                port: null
                user: root
                password: null
                logging: true
                profiling: true
                profiling_collect_backtrace: false
                profiling_collect_schema_errors: true
                options: {  }
                mapping_types: {  }
                slaves: {  }
                replicas: {  }
                shards: {  }
        types: {  }
    orm:
        auto_generate_proxy_classes: true
        default_entity_manager: default
        entity_managers:
            default:
                naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
                auto_mapping: true
                mappings:
                    App:
                        is_bundle: false
                        type: annotation
                        dir: '/Users/mathildedion/chamla 15.53.49/src/Entity'
                        prefix: App\Entity
                        alias: App
                        mapping: true
                query_cache_driver:
                    type: null
                Metadata_cache_driver:
                    type: null
                result_cache_driver:
                    type: null
                class_Metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory
                default_repository_class: Doctrine\ORM\EntityRepository
                quote_strategy: doctrine.orm.quote_strategy.default
                entity_listener_resolver: null
                repository_factory: doctrine.orm.container_repository_factory
                hydrators: {  }
                filters: {  }
        proxy_dir: '%kernel.cache_dir%/doctrine/orm/Proxies'
        proxy_namespace: Proxies
        resolve_target_entities: {  }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...