Skip to content
This repository was archived by the owner on Dec 7, 2025. It is now read-only.
This repository was archived by the owner on Dec 7, 2025. It is now read-only.

An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused #39

@ajabusch

Description

@ajabusch

Hi I followed the instructions in the readme, but I got an error at

php bin/console doctrine:schema:create

saying:

    In ToolsException.php line 34:
                                                                                                                                                                                          
      Schema-Tool failed with Error 'An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused' while executing DDL: CREATE TABLE fos_user (id INT AUTO_INCREMENT NOT N  
      ULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, sa  
      lt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAU  
      LT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', UNIQUE INDEX UNIQ_957A647992FC23A8 (username_canonical), UNIQUE INDEX UNIQ_957A6479A0D96FBF (email_canonical), UNIQUE   
      INDEX UNIQ_957A6479C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB                                       
                                                                                                                                                                                          

    In AbstractMySQLDriver.php line 112:
                                                                                  
      An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused  
                                                                                  

    In Exception.php line 18:
                                                 
      SQLSTATE[HY000] [2002] Connection refused  
                                                 

    In PDOConnection.php line 37:
                                                 
      SQLSTATE[HY000] [2002] Connection refused  

and (maybe related) when loading the fixtures

php bin/console doctrine:fixtures:load

I get

    In AbstractMySQLDriver.php line 112:
                                                                                  
      An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused  
                                                                                  

    In Exception.php line 18:
                                                 
      SQLSTATE[HY000] [2002] Connection refused  
                                                 

    In PDOConnection.php line 37:
                                                 
      SQLSTATE[HY000] [2002] Connection refused  

(DB container is running and accessible from host via port 5432)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions