doy2255 2019-07-14 16:04
浏览 920

驱动程序中发生异常:SQLSTATE [HY000] [2002]连接被拒绝尝试在symfony 3.4上创建数据库

I tried to create a databse in doctrune 3.4 with php bin/console doctrine:database:create command but I get this error

`Failed loading /opt/lampp/lib/php/extensions/no-debug-non-zts-20180731`/xdebug.so:  /opt/lampp/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so: cannot open shared object file: No such file or directory

In AbstractMySQLDriver.php line 103:

  An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused  


In PDOConnection.php line 47:

  SQLSTATE[HY000] [2002] Connection refused  


In PDOConnection.php line 43:

  SQLSTATE[HY000] [2002] Connection refused

This is the setting on config.yml

doctrine:
    dbal:
        driver: pdo_mysql
        host: '%database_host%'
        port: '%database_port%'
        dbname: '%database_name%'
        user: '%database_user%'
        password: '%database_password%'
        charset: utf8mb4
        default_table_options:
            charset: utf8mb4
            collate: utf8mb4_unicode_ci

I'm uging xampp MariaDb 10.1 version and the doctrine built-in server to develop

  • 写回答

1条回答 默认 最新

  • douliao7930 2019-07-15 04:49
    关注

    Maybe you did not yet configure your parameters.yml as indicated in official documentation of symfony.

    Before you launch the command to create database, you have to configure first in parameters.yml and check also in the config.yml

    Check it here: https://symfony.com/doc/3.4/doctrine.html

    or if you want, if you can access the mysql terminal. Just directly create database there.

    Example: CREATE DATABASE 'database_name' CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!