I don't know if that is the "preferred" method, but I think it would work.
You will want to document this idiosyncrasy for future developers, and maybe add some verbose errors/logging pointing to misconfigurations in this unusual setup. If you only want to specify one database, for example, it should be clear that it needs to be specified in quasi-JSON style anyway.
I think more 12-factor-y, though, would be to set up an intermediate load-balancer between your servers. That way, your app can connect to the load balancer or a single server with very little transparency as to the nature of the underlying service.
So instead of:
SetEnv DB {mysql://something@somewhere, mysql://something@somewhereelse}
you would have
SetEnv DB mysql://something@load-balancer
and the load-balancer handles the multiple databases behind the scenes.
You could also have a 2-db system, one for reads and one for writes. The reads could be load-balanced and replicate the master-server
.
SetEnv READ_DB mysql://something@load-balancer
SetEnv WRITE_DB mysql://something@master-server
then in a test situation they would use the same connection string:
SetEnv READ_DB mysql://something@load-balancer
SetEnv WRITE_DB $READ_DB # not sure about syntax here