Skip to content

About

Run Databend in Docker and query it over the MySQL protocol or the HTTP SQL API.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Arya Fatthurahman

Databend Lab

Run Databend in Docker and query it over the MySQL protocol or the HTTP SQL API.

Database: Databend Category: Cloud-native OLAP Runs in Docker License: MIT compose-check

What this lab is

Databend is a Rust-based OLAP database with a MySQL-compatible endpoint and an HTTP SQL API. This lab starts the standalone image, creates a small table, and shows both connection paths so you can use DBeaver, a MySQL client, or plain curl.

Quickstart

docker compose up -d
curl -sS -X POST http://localhost:8000/v1/query -H 'Content-Type: application/json' -d '{"sql":"SELECT 1 AS ok"}'
# with a MySQL client:
mysql -h 127.0.0.1 -P 3307 -u root < examples/01_schema.sql
mysql -h 127.0.0.1 -P 3307 -u root < examples/02_queries.sql

Connection details

Field Value
MySQL protocol mysql -h 127.0.0.1 -P 3307 -u root
HTTP SQL API http://localhost:8000/v1/query
User root
Password (empty in this lab)
DBeaver MySQL driver, host 127.0.0.1, port 3307

Examples

File What it shows
docker-compose.yml Engine, ports, and persistent volume.
.github/workflows/compose-check.yml Validates the Compose file on every push.
examples/01_schema.sql A small events table with Databend types.
examples/02_queries.sql Aggregation and a window function.

Exercises

  1. Query the HTTP API with curl and compare the JSON response with the MySQL client output.
  2. Create a table with a Variant column and query a nested field.
  3. Load a CSV with COPY INTO and check the row count.
  4. Connect DBeaver through the MySQL driver and inspect the system tables.

Notes and limits

  • The standalone image keeps data inside the container; restarting it resets the lab data.
  • The MySQL endpoint is on port 3307 to avoid clashing with a local MySQL/MariaDB on 3306.
  • The HTTP API may require authentication in newer versions; check the upstream docs if SELECT 1 is rejected.
  • Pin a release tag instead of latest if you need reproducible behavior.

Run it from anywhere

This lab publishes its ports on 127.0.0.1 only. To use it from another country, do not open the database port to the internet. Pick one:

  • VPS + private tunnel: run the lab on a small Ubuntu VPS, keep the port closed, and connect through WireGuard or ssh -L.
  • Managed service: use a managed free tier for this engine and point the same examples at its connection string.
  • HTTP UI only: if the engine has a web UI, put it behind Caddy with TLS and basic auth.

The shared checklist, provider map, and commands are in REMOTE-ACCESS.md.

Cleanup

docker compose down -v

-v also removes the named volume, so the next start is a clean slate.

References


Part of the database-labs collection: 26 database engines, one index.

License

MIT (c) 2026 Arya Fatthurahman. See LICENSE.

About

Run Databend in Docker and query it over the MySQL protocol or the HTTP SQL API.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors