I had the same issue of connection refused from the mariadb docker. for me, the error was the account I created only had permissions to connect locally, not from another docker. what worked for me was:
set the DB_HOST value to the IP address of the Unraid server and the nonstandard port that I had set up for the mariadb docker like this: 192.168.10.10:33069 and granting the privileges for the
[email protected] (the network segment I run the mariadb and bookstack on, since the request via the unraid IP will be routed through there). technicalramblings has a great article on this.
adding this as it might help someone down the line.