As Apache can set PHP settings values in the .htaccess file, can Apache also set MySQL settings values?
Something like:
mysql_value mysqld.datadir /mysql/devdata/
This is a non-specific question as I know there are other ways to accomplish the task at hand.
The task is to get the same website/docroot to use a different database (but named the same) based on the subdomain of the URL.