diff --git a/Using-MySQL-Backend.md b/Using-MySQL-Backend.md new file mode 100644 index 0000000..14080e9 --- /dev/null +++ b/Using-MySQL-Backend.md @@ -0,0 +1,21 @@ +To use the MySQL backend, first ensure you build the binary [with MySQL feature enabled](https://github.com/dani-garcia/bitwarden_rs/wiki/Building-binary#mysql-backend). + +To run the binary or container ensure the ```DATABASE_URL``` environment variable is set (i.e. ```DATABASE_URL='mysql://:@mysql/bitwarden```). + +Example using docker +``` +# Start a mysql container +docker run --name mysql --net \ + -e MYSQL_ROOT_PASSWORD=\ + -e MYSQL_DATABASE=bitwarden\ + -e MYSQL_USER=\ + -e MYSQL_PASSWORD= -d mysql:5.7 + +# Start bitwarden_rs with MySQL Env Vars set. +docker run -d --name bitwarden --net \ + -v $(pwd)/bw-data/:/data/ -v :/ssl/\ + -p 443:80 -e ROCKET_TLS='{certs="/ssl/",key="/ssl/"}'\ + -e RUST_BACKTRACE=1 -e DATABASE_URL='mysql://:@mysql/bitwarden'\ + -e ADMIN_TOKEN=\ + -e ENABLE_DB_WAL='false' +``` \ No newline at end of file