The previous 5-second fixed wait was insufficient for MySQL 8.0 to fully initialize, causing migrations and seeders to fail with 'Connection refused'. Changes: - Replace 'sleep 5' with active connection polling - Try to connect every second for up to 30 seconds - Use PHP PDO to test actual database connectivity - Only proceed when database accepts connections - Show clear status when database is ready This ensures migrations and seeders run only after database is fully ready, preventing 'Connection refused' errors on fresh setup. Fixes the issue where Laravel loads but shows MySQL connection error.
6.6 KiB
6.6 KiB