Installation
VDB for MySQL ships as one container image for linux/amd64 and linux/arm64. It runs on any host with Docker (Linux, macOS, Windows).
Requirements
- A MySQL 8.4 Source reachable over TLS (managed clouds such as AWS RDS, Google Cloud SQL and Azure Database for MySQL work with nothing to set up; see TLS)
- A read-only service account on the Source (below)
- Docker
Run
docker run -p 3306:3306 \
-e VDB_SOURCE_HOST=db.example.com \
-e VDB_SOURCE_USER=vdb_svc -e VDB_SOURCE_PASSWORD=... \
ghcr.io/virtual-db/vdb-mysql:<version>Releases are listed on GitHub; latest follows the newest stable release. Every setting is in the Configuration reference.
The port opens only when the environment is complete, so a port check is the readiness probe. Then connect with any MySQL client or driver, with your Source credentials: VDB relays every login to the Source, so the same users, passwords and privileges apply.
mysql -h 127.0.0.1 -P 3306 -u your_user -pA SELECT returns your Source's data. An INSERT, UPDATE or DELETE succeeds and is visible to every session of this environment, but the Source is never written. Stop the container and the changes are gone.
Mount a volume at /var/lib/vdb/tmp to size mysqld's temporary space.
The service account
VDB reads the Source with one account. It needs to read the exposed data and the grant tables, and nothing else:
CREATE USER 'vdb_svc'@'%' IDENTIFIED BY '...' REQUIRE SSL;
GRANT SELECT, SHOW VIEW ON app.* TO 'vdb_svc'@'%';
GRANT SELECT (User, Host, plugin, ssl_type, account_locked, password_expired, User_attributes, Process_priv,
Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Alter_priv, Index_priv,
References_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Execute_priv,
Trigger_priv, Create_tmp_table_priv, Lock_tables_priv) ON mysql.user TO 'vdb_svc'@'%';
GRANT SELECT ON mysql.db TO 'vdb_svc'@'%';
GRANT SELECT ON mysql.tables_priv TO 'vdb_svc'@'%';
GRANT SELECT ON mysql.columns_priv TO 'vdb_svc'@'%';
GRANT SELECT ON mysql.procs_priv TO 'vdb_svc'@'%';
GRANT SELECT ON mysql.role_edges TO 'vdb_svc'@'%';
GRANT SELECT ON mysql.default_roles TO 'vdb_svc'@'%';
GRANT SELECT ON mysql.global_grants TO 'vdb_svc'@'%';
GRANT SHOW_ROUTINE ON *.* TO 'vdb_svc'@'%';The password hash column of mysql.user is never granted and never read. Without the grant-table reads, VDB learns accounts at their first login instead (vdb.accounts says which mode is in use).