DATABASE_URL not recognized as mysql? #533

Closed
opened 2026-02-04 21:27:05 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @pdarcos on GitHub (Dec 20, 2019).

Hi,
I built the bitwarden_rs binary with mysql according to the wiki, but when I try to run it it seems to not recognize my DATABASE_URL as mysql and exits.

What's the proper way to pass the DATABASE_URL environment variable when starting the project (not in docker)?

./bitwarden_rs -e DATABASE_URL='mysql://bitwarden_rs:secretpass@localhost:3306/bitwarden_rs'

Error loading config:
DATABASE_URL should start with mysql: when using the MySQL server

Thanks

Originally created by @pdarcos on GitHub (Dec 20, 2019). Hi, I built the bitwarden_rs binary with mysql according to the wiki, but when I try to run it it seems to not recognize my DATABASE_URL as mysql and exits. What's the proper way to pass the DATABASE_URL environment variable when starting the project (not in docker)? ./bitwarden_rs -e DATABASE_URL='mysql://bitwarden_rs:secretpass@localhost:3306/bitwarden_rs' Error loading config: `DATABASE_URL` should start with mysql: when using the MySQL server Thanks
Author
Owner

@pdarcos commented on GitHub (Dec 20, 2019):

Answering myself so future readers don't waste time:

I had to set the DATABASE_URL variable in the .env file and now it works. Apparently you cannot pass it environment variables on the command line when not using the docker image.

@pdarcos commented on GitHub (Dec 20, 2019): Answering myself so future readers don't waste time: I had to set the DATABASE_URL variable in the .env file and now it works. Apparently you cannot pass it environment variables on the command line when not using the docker image.
Author
Owner

@mqus commented on GitHub (Dec 20, 2019):

btw, if you want to pass a variable like DATABASE_URL to bitwarden_rs or any other executable, you can do so by starting it in a shell with

DATABASE_URL='mysql://bitwarden_rs:secretpass@localhost:3306/bitwarden_rs' bitwarden_rs

I'm not sure if that works in a standard windows terminal/powershell but it works everywhere else.

But I recommend setting it in the .env file because you usually want to set multiple options and preprending them can get messy fast.

@mqus commented on GitHub (Dec 20, 2019): btw, if you want to pass a variable like `DATABASE_URL` to `bitwarden_rs` or any other executable, you can do so by starting it in a shell with ``` DATABASE_URL='mysql://bitwarden_rs:secretpass@localhost:3306/bitwarden_rs' bitwarden_rs ``` I'm not sure if that works in a standard windows terminal/powershell but it works everywhere else. But I recommend setting it in the `.env` file because you usually want to set multiple options and preprending them can get messy fast.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#533