Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

username1's avatar

docker not responding?

good day, I tried to run the port of my php port then error shows up like this. SQLSTATE[HY000] [2002] Connection refused (SQL: select * from sessions where id = Jm6HlI2ZWl7w76oTGJvTyexxmX98bQcxUUOKxTCG limit 1), I already run wamp for this. and check my mysql config and it's all good i guess, I dont know why is this error came up. please help im new to docker thank you.

this is my mysql set up,,,

     # MySQL Services
    mysql:
         image: mysql:5.7
         container_name: wellmade_mysql
         restart: always
    
        ports:
          - "33061:3306"
        environment:
        MYSQL_DATABASE: ${DB_DATABASE}
        MYSQL_ALLOW_EMPTY_PASSWORD: 1
        MYSQL_PASSWORD: ""
      
        networks:
           - laraveldockerize

and this is my .env file,,,

     DB_CONNECTION=mysql
     DB_HOST=127.0.0.1
     DB_PORT=3306
     DB_DATABASE=wellmade-server45
     DB_USERNAME=root
     DB_PASSWORD=
0 likes
3 replies
zoidq's avatar
zoidq
Best Answer
Level 7

Your problem is most likely the DB_HOST setting in your .env file.

You could share your entire docker compose config file to get better feedback, assuming you are also running php-fpm within a docker container.

In the meantime, try changing your DB_HOST to "mysql" and see if that works.

DB_HOST=mysql
username1's avatar

@zoidq after changing db_host this error occurs, SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wellmade-server45.sessions' doesn't exist, what 's the next step to do? Im just new in docker

username1's avatar

after changing db_host another error appears SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wellmade-server45.sessions' doesn't exist

Please or to participate in this conversation.