Instead of creating special class you can setup in web.config which membership provider you use.
For Oracle there exist an OracleMembershipProvider
class, which you can find here.
For MySQL you can use MySQLMembershipProvider
. There is a nice article how you can setup it: How to Setup and Configure MySql Membership Provider
Moreover you can use Entity Framework Code First Membership Provider and use proper provider (look on this article: Entity Framework Code-First support for Oracle, MySQL, PostgreSQL and SQLite). I did not try this solution, but it looks promising.
If nothing above helps you can write your own Memebership provider, but I am sure that you can find something which already exists.
To sum up: Instead of changing connection type, change membership provider which will be specific for your needs. Your code shouldn't notice change, because every membership provider inherits base MemebershipProivder
class