Skip to content

Windows Setup MySQL and Docker

JohanEger edited this page Aug 24, 2026 · 4 revisions

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.

One-time setup

1. Install Java21 and Node.js

Install Java 21 if you use an older version, and update JAVA_HOME and path. Install Node.js (MSI installer recommended) and update path.

1. Install MySQL 8.0.4

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.

3. Install a Docker runtime

https://docs.docker.com/desktop/setup/install/windows-install/

4. Set environment variables

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-password

Replace your-local-password with a password used only for local development, and use the same value when creating the user in step 4.

5. Create the database and user

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;

6. Verify the stack

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 verify

Expected: 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:run

Expected 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.

Clone this wiki locally