I think you should develop locally or on a machine that is not Internet facing. That way, you don't need to worry about test databases being stolen.
For production or other supporting environments (uat, dev, DR sites etc), you need to lock down the databases such that only a certain user can access from a certain machine. If you're deploying in AWS for example, you can shut down all access to your db other than that by your application server by placing your db in a non public facing VM, allowing connections from only your app servers ip addresses and harden it even further by using IAM roles. No simple solution to securing anything but it's a start.