How to plug basic auth to an existing database?

You can;t plug Tyk into it, but you can use Tyk Identity Broker to bridge the gap and turn BA requests into token based ones:

Intro is here:

And the method you would us is: