[GH-ISSUE #2591] Using environment variables for connection string to MySQL db (running in docker)? #870

Closed
opened 2026-03-07 20:55:58 +03:00 by kerem · 0 comments
Owner

Originally created by @dev-samples on GitHub (May 6, 2024).
Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/2591

Is it possible to read e.g. hostname, user and password for a connection to e.g. and external MySQL db?

I have created this data-sources.json file

{
	"folders": {},
	"connections": {
		"mysql8-18f4fad411e-67d520a52b28e036": {
			"provider": "mysql",
			"driver": "mysql8",
			"name": "MySQL@${mysql-host.name}:3306",
			"configuration": {
				"host":"${mysql-host.name}",
				"port": "33306",
				"url": "jdbc:mysql://${mysql-host.name}:3306/",
				"configurationType": "MANUAL",
				"type": "dev",
				"closeIdleConnection": true,
				"auth-model": "native"
			}
		}
	},
	"connection-types": {
		"dev": {
			"name": "Development",
			"color": "255,255,255",
			"description": "Regular development database",
			"auto-commit": true,
			"confirm-execute": false,
			"confirm-data-change": false,
			"smart-commit": false,
			"smart-commit-recover": false,
			"auto-close-transactions": true,
			"close-transactions-period": 1800,
			"auto-close-connections": true,
			"close-connections-period": 14400
		}
	}
}

but when I pass that to my docker run command it just gets ignored:

  docker run \
  --rm -it \
  -e CB_SERVER_NAME='cloudbeaver'\
  -e CB_ADMIN_NAME='administrator' \
  -e CB_ADMIN_PASSWORD='S0mePazzworD' \
  -e mysql-host.name='test-mysql' \
  -p 8080:8978 \
  --name dbbeaver \
  dbbeaver

image

I found some info here:
https://github.com/bobbyiliev/dbeaver/wiki/Admin-Manage-Connections#using-environment-variables

but its not really clear how to do this - e.g. if there are only a set of fields that support this?

Originally created by @dev-samples on GitHub (May 6, 2024). Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/2591 Is it possible to read e.g. hostname, user and password for a connection to e.g. and external MySQL db? I have created this **data-sources.json** file ``` { "folders": {}, "connections": { "mysql8-18f4fad411e-67d520a52b28e036": { "provider": "mysql", "driver": "mysql8", "name": "MySQL@${mysql-host.name}:3306", "configuration": { "host":"${mysql-host.name}", "port": "33306", "url": "jdbc:mysql://${mysql-host.name}:3306/", "configurationType": "MANUAL", "type": "dev", "closeIdleConnection": true, "auth-model": "native" } } }, "connection-types": { "dev": { "name": "Development", "color": "255,255,255", "description": "Regular development database", "auto-commit": true, "confirm-execute": false, "confirm-data-change": false, "smart-commit": false, "smart-commit-recover": false, "auto-close-transactions": true, "close-transactions-period": 1800, "auto-close-connections": true, "close-connections-period": 14400 } } } ``` but when I pass that to my docker run command it just gets ignored: ``` docker run \ --rm -it \ -e CB_SERVER_NAME='cloudbeaver'\ -e CB_ADMIN_NAME='administrator' \ -e CB_ADMIN_PASSWORD='S0mePazzworD' \ -e mysql-host.name='test-mysql' \ -p 8080:8978 \ --name dbbeaver \ dbbeaver ``` <img width="684" alt="image" src="https://github.com/dbeaver/cloudbeaver/assets/57432209/b009c83f-2dd4-4f10-87ef-20432aa5345e"> I found some info here: https://github.com/bobbyiliev/dbeaver/wiki/Admin-Manage-Connections#using-environment-variables but its not really clear how to do this - e.g. if there are only a set of fields that support this?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudbeaver#870
No description provided.