I just discovered that the environment visible to a process itself is fixed length, so if you add or change you need to do that on a copy and realloc the environment. That is a bit too much for something that otherwise just requires an install script. The low-level way is, well, very,very low level in this case. Can be done, though. But I advise against it.
(On Windows it is very easy, alas not on UNIXes)
A third option is to link statically libmysqlclient.a but I don't know if this will succeed and probably needs to change some interface files.