Creating a default ASP.NET MVC project in Visual Studio sets up a basic project where you can register a user. How would I go on changing this to use a MySQL server instead of SQLServer ?
Got it working now.
Replace the default connection string in web.config with something like:
<add name="ApplicationServices" connectionString="server=192.168.1.30;user id=thsuser;Password=thepass;database=thedatabase" providerName="MySql.Data.MySqlClient"/>
Under the section in web.config add the following (for the 6.0.4.0 mysql connector atleast), add
<add autogenerateschema="true" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/" name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.0.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
Run the project, go back into Visual Studio and click the ASP.NET Configuration button above the solution explorer.
Navigate to "Provider Configuration"->"Select a different provider for each feature " and select the "MySQLMembershipProvider"
Works atleast for registering and logging in from a mysql database, the MySQLMembershipProvider will autogenerate the needed tables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With