Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused #131

Closed
truckee opened this issue Dec 27, 2020 · 1 comment
Closed

Connection refused #131

truckee opened this issue Dec 27, 2020 · 1 comment

Comments

@truckee
Copy link

truckee commented Dec 27, 2020

I've installed eko/docker-symfony in WSL2/Ubuntu-20, along with a working Symfony project in dev mode. On launching http://symfony.localhost/ I get a MySQL

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

The exception is thrown in an entity's repository:

        $fileNames = $this->createQueryBuilder('f')
                ->select('f')
                ->orderBy('f.filename', 'DESC')
                ->getQuery()
                ->getArrayResult()
        ;

Edit: (logs available after docker-compose down & docker-compose up).

Stuck dd($params) in Doctrine\DBAL\Driver\PDOMySql\AbstractMySQLDriver and got this:

Driver.php on line 22:
array:11 [▼
  "url" => "mysql://symfony:symfony@127.0.0.1:3306/rv?serverVersion=8.0"
  "host" => "127.0.0.1"
  "port" => 3306
  "user" => "symfony"
  "password" => "symfony"
  "driver" => "pdo_mysql"
  "driverOptions" => []
  "defaultTableOptions" => array:1 [▶]
  "dbname" => "rv"
  "serverVersion" => "8.0"
  "charset" => "utf8mb4"
]

From logs/nginx:

172.25.0.1 - - [28/Dec/2020:14:38:06 +0000] "GET / HTTP/1.1" 500 479223 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
172.25.0.1 - - [28/Dec/2020:14:38:10 +0000] "GET /_wdt/6fa7eb HTTP/1.1" 200 4339 "http://symfony.localhost/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

After installing MySQL client in WSL/Ubuntu:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

In PowerShell:

ERROR 1045 (28000): Access denied for user 'symfony'@'172.27.0.1' (using password: YES)

Edit:
docker-compose exec db mysql -u root -p allows connection.

@truckee
Copy link
Author

truckee commented Dec 29, 2020

Should have found issue at #83.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant