Latish Sehgal's Blog

Using MySQL With for Authentication/authorization

MySQL database is a good option for projects that need large stable databases but cannot afford the Oracle or MSSQL price tag. The provider model in Asp.Net 2.0 allows us to use MySql with plenty of Out of the Box functionality. When using Forms Authentication, you can just configure the application to use the MySQL provider, and then use the ASP.NET Web Site Administration tool to manage users and roles in your application.

  1. Make sure you have installed the latest version of MySQL Connector/Net. This also adds an entry each to the membership and rolemanager providers in the machine.config files behind the scenes.

  2. Open the Asp.Net Web Site Administration page, go to ‘Provider ’ tab and click on “Select a different provider for each feature (advanced)”.

  3. Select ‘MySQLMeMbershipProvider ’ as the Membership Provider, and ‘MySQLRoleProvider ’ as the Role Provider.

  1. Add the connectionstring to your MySQL server under the name ‘LocalMySQLServer’.

  1. Goto ‘Security’ tab and manage your users and roles.