title: Lumen / Docker / MySQL (SQLSTATE[HY000] [2002] Connection refused) But I can connect externally
body: <p>Losing my mind on this one.</p>
  
  <p>I've got a Lumen and MySQL setup in a Docker container. Most everything is good to go.  I can run the container and access Lumen through a browser.  I can access MySQL through Sequel Pro, no problem.  And I can run <code>php artisan migrate</code> and it works fine.  </p>
  
  <p>But if I try to do anything through Lumen in the browser, it won't connect to the database, and it gives me the Connection refused error.</p>
  
  <p>I'm using Lumen 5.7.7 and .env file looks like this:</p>
  
  <pre><code>DB_CONNECTION=mysql
  DB_HOST=127.0.0.1
  DB_PORT=3306
  DB_DATABASE=test
  DB_USERNAME=root
  DB_PASSWORD=root
  </code></pre>
  
  <p>docker-compose.yml looks like this:</p>
  
  <pre><code>version: '3'
  services:
    api:
      build:
        context: .
        dockerfile: .docker/Dockerfile
      image: laravel-docker
      ports:
        - 8080:80
      depends_on:
        - mysqldb
      volumes:
        - .:/srv/app
      # container_name:
    mysqldb:
      image: mysql:5.7
      container_name: mysqldb
      command: mysqld --user=root --verbose
      volumes:
         - ./schemadump.sql:/docker-entrypoint-initdb.d/schemadump.sql
      ports:
        - 3306:3306
      environment:
        MYSQL_DATABASE: test
        MYSQL_USER: test
        MYSQL_PASSWORD: test
        MYSQL_ROOT_PASSWORD: root
        MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
  </code></pre>
  
  <p><strong>EDIT:</strong> Ran phpinfo() on the site and on the command line and realized that they aren't even the same version, let alone the same exact details.  Could that be the problem here?  Looking at it more...</p>