symfony 4.3教义:数据库:创建连接被拒绝

时间:2019-11-10 04:11:41

标签: symfony

嗨,当我在终端中输入命令时,我正在尝试为我的项目创建数据库,他给了我这种信息,我尝试在google中查看,但找不到任何有用的东西

driver: 'mysql'
    server_version: '5.7'

    # only needed for MySQL
    charset: utf8mb4
    default_table_options:
        charset: utf8mb4
        collate: utf8mb4_unicode_ci

    url: '%env(resolve:DATABASE_URL)%'
orm:
    auto_generate_proxy_classes: true
    naming_strategy: doctrine.orm.naming_strategy.underscore
    auto_mapping: true
    mappings:
        App:
            is_bundle: false
            type: annotation
            dir: '%kernel.project_dir%/src/Entity'
            prefix: 'App\Entity'
            alias: App

Connection refused

1 个答案:

答案 0 :(得分:0)

updata:我找到了制作数据库的最佳方法

对于doctrine.yaml doctrine:     dbal:         # configure these for your database server         driver: 'pdo_mysql'         server_version: '5.7'         charset: utf8mb4         host: 127.0.0.1         port: 8889         user: '%env(DATABASE_USER)%'         password: '%env(DATABASE_PWD)%'         dbname: '%env(DATABASE_NAME)%'

用于环境DATABASE_USER=root DATABASE_PWD=root DATABASE_NAME=database name DATABASE_HOST=127.0.0.1