So I have three machines:
2 x Laravel app
1 x MySQL
MySQL machine is up and running and I can SSH into the Laravel machines and connect to the MySQL machine via the internal name, IE [mysql-machine-name].internal on port 3306.
However, I am trying to redeploy the Laravel app machines (as I have changed them from using LiteFS to using MySQL which is another story).
The dockerfile works until we get to the command:
php artisan migrate --force
At this point it tries to connect to the database and fails with:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for sslv2-mysq
0.364 l-deploy.internal failed: Name or service not known (Connection: mysql, SQL
0.364 : select exists (select 1 from information_schema.tables where table_schema
0.364 = āssl_dbā and table_name = āmigrationsā and table_type in (āBASE TABLEā,
0.364 āSYSTEM VERSIONEDā)) as exists
)
0.364
0.364
0.364 In Connector.php line 66:
0.364
0.364 SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for sslv2-mysq
0.364 l-deploy.internal failed: Name or service not known
0.364
0.364
0.364 In Connector.php line 66:
0.364
0.364 PDO::__construct(): php_network_getaddresses: getaddrinfo for sslv2-mysql-d
0.364 eploy.internal failed: Name or service not known
So this looks like the Laravel machine cannot access the MySQL machine using the āsslv2-mysql-deploy.internalā host name.
Yet, if I comment those Laravel migration scripts out it builds and deploys and then I can SSH into the machine and connect to the MySQL instance using the same internal name.
Its as if the internal name is not available when the migration starts.
Any ideas?