Repository navigation
Windows Setup MySQL and Docker
Companion to MySQL Persistence Setup, which describes what this configures and the migration workflow that follows it.
This page covers the Windows-specific parts: installing MySQL 8.4, installing a Docker runtime for the integration test, creating the local database, and setting the environment variables.
Sections marked "to be written" need a Windows user to complete them, matching the structure of the macOS page.
Install Java 21 if you use an older version, and update JAVA_HOME and path. Install Node.js (MSI installer recommended) and update path.
Go to https://dev.mysql.com/downloads/installer/ and select either installer. When installing, it is recommended to select "install Workbench" unless you already have a MySQL interface installed.
https://docs.docker.com/desktop/setup/install/windows-install/
create a .env file inside backend in fairshare:
spring.datasource.url=jdbc:mysql://localhost:3306/fairshare
spring.datasource.username=fairshare_dev
spring.datasource.password=your-local-passwordReplace your-local-password with a password used only for local development, and use the same
value when creating the user in step 4.
Sign in to MySQL as an administrative user (using Workbench if you installed it, you must first select the MySQL server on the home page), then run:
CREATE DATABASE fairshare;
CREATE USER 'fairshare_dev'@'localhost' IDENTIFIED BY 'your-local-password';
GRANT ALL PRIVILEGES ON fairshare.* TO 'fairshare_dev'@'localhost';
FLUSH PRIVILEGES;Run the backend verification. Open a terminal in Docker and navigate to fairshare Testcontainers starts a throwaway MySQL container and never uses the local database or its credentials.
Set-Location backend
.\mvnw.cmd --batch-mode clean verifyExpected: BUILD SUCCESS with no test failures or errors. The first run pulls the mysql:8.4 image,
about 600 MB, and takes noticeably longer than later runs.
Run the application, which does use the local database through the environment variables:
.\mvnw.cmd spring-boot:runExpected log lines: Database JDBC URL [jdbc:mysql://localhost:3306/fairshare],
Tomcat started on port 8080, and Started FairShareApplication. A 404 from / is expected unless
a root route has been implemented. Stop with Ctrl+C.