@echo off
echo Fixing MySQL connection issues...

echo Step 1: Stopping containers...
docker-compose down

echo Step 2: Removing MySQL data volume...
docker volume rm ukdataservices_mysql_data

echo Step 3: Starting containers fresh...
docker-compose up -d

echo Step 4: Waiting for MySQL to initialize...
timeout /t 30

echo Step 5: Testing connection...
docker exec ukdataservices-db mysql -u root -prootpassword -e "SHOW DATABASES;"

echo.
echo MySQL should now be accessible with:
echo Username: root
echo Password: rootpassword
echo.
echo OR
echo.
echo Username: webuser  
echo Password: webpassword
echo Database: ukdataservices
echo.
pause
