No idea, but why don't you work with Laragon ? You wouldn't have the problems with docker.
Jun 22, 2023
3
Level 1
Mysql SQLSTATE[HY000] [2002] Connection refused
Hi,
I freshly installed laravel 10. Running on WSL-windows-docker.
My database settings are using mysql.
My artisan commands work (php artisan migrate:fresh; php artisan db:seed;), but when I try it on the localhost-webpage, it fails. Error shown is
SQLSTATE[HY000] [2002] Connection refused (Connection: mysql, SQL: select * from....
Docker-mysql log shows it is running
2023-06-22 21:21:32 example-app-mysql-1 | 2023-06-22T13:21:32.653665Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-22 21:21:32 example-app-mysql-1 | 2023-06-22T13:21:32.771970Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-06-22 21:21:33 example-app-mysql-1 | 2023-06-22T13:21:33.030321Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-06-22 21:21:33 example-app-mysql-1 | 2023-06-22T13:21:33.030374Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-06-22 21:21:33 example-app-mysql-1 | 2023-06-22T13:21:33.059246Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2023-06-22 21:21:33 example-app-mysql-1 | 2023-06-22T13:21:33.059405Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.32' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
When I switch it to use sqlite, both artisan and webpage works.
Any ideas ?
Please or to participate in this conversation.