Bug #53076 | Unable to initialize provider. Missing or incorrect schema. | ||
---|---|---|---|
Submitted: | 22 Apr 2010 18:21 | Modified: | 11 May 2011 16:16 |
Reporter: | Andreas Berglund | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 6.2.2 | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | MySqlMembershipProvider |
[22 Apr 2010 18:21]
Andreas Berglund
[22 Apr 2010 18:22]
Andreas Berglund
My Web.Config
Attachment: Web.Config.txt (text/plain), 11.01 KiB.
[23 Apr 2010 5:54]
Tonci Grgin
Hi Andreas and thanks for your report. If you put S1 in severity I expect, at least, an attached test case so to spped things up. My guess would be your schema is somehow wrong. Can you check on sql scripts in MySql.Web\Providers\Properties and data in database where my_aspnet_SchemaVersion.version should be 6.
[23 Apr 2010 9:45]
Andreas Berglund
Hi. It seems that the tables arent generated in Windows 2003/IIS 6.0 even though autogenerateschema="true". In Linux/Apache/mod_mono and Visual Studio's built in web server the tables are created and my_aspnet_SchemaVersion.version = 6 in both cases. Also, in Windows 2003/IIS 6.0 it doesnt work even if the tables are already there with the correct my_aspnet_SchemaVersion.version. /Andreas
[26 Apr 2010 11:16]
Tonci Grgin
Andreas, I only have IIS7 on 2K8R2 x64 server. Will see if I can do anything about this.
[26 Apr 2010 11:27]
Tonci Grgin
Andreas, I got reply from devs regarding this. 1) Autogenerate schema: If there is an error in your connect string, autogenerate will not work and this message comes up. 2) If the whole string connection string is correct and the "database" attaching to exists, there should be no problem with 2K3/IIS6 combination... Which brings us back to test case...
[26 Apr 2010 12:05]
Vladislav Vaintroub
The connection string has to be correct, and include an existing database. Then autogenerateschema works. I spent some time last week staring at the very same error message, until I realized my connection string does not have the database.
[26 Apr 2010 13:05]
Andreas Berglund
Hi. The connectionstring is correct. I am using the same connectionstring to query other tables within the same database and in the same MVC application. The database user have ALL PRIVILEGES on said database. I've published the MVC application to two different servers: * One running Linux/Apache/mod_mono - http://webshop.jabit.se * The other running Windows Server 2003 and IIS 6.0 - http://ns1.tvbritannia.com:443/ The Category Treeview on the index page is loaded from the database using the exact same connection string being used by MysqlMembershipProvider. On both servers the treeview loads just fine. However, when you click [Log on] it fails on the windows server (this is where the MembershipProvider initialization happens as far as i know). It is also the exact same Web.Config on both systems. /Andreas
[5 May 2010 12:39]
Tonci Grgin
I know I sound like a broken record but what about the test case?
[5 May 2010 12:44]
Andreas Berglund
Haha. No problem at all. I should have attached one earlier, but i've been busy building our MVC application. I have a deadline to beat... The test case is the default MVC application in Visual Studio 2008, using MySqlMembershipProvider instead... I will go ahead and create that (it will only take a few mins) then attach it here... But... not right away, sorry. /Ante
[5 May 2010 12:45]
Tonci Grgin
Andreas, no problem, I'll leave the bug in "NeedFB" till test case is attached.
[5 Jun 2010 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[17 Jun 2010 5:44]
Tonci Grgin
Still waiting.
[17 Jul 2010 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[8 Sep 2010 11:59]
Yoda from Hoth
I have the same problem here and nobody can give me the answer.
[8 Sep 2010 12:04]
Tonci Grgin
Yoda, please read the report before posting: [5 May 14:39] Tonci Grgin I know I sound like a broken record but what about the test case? So, are *you* going to provide a repeatable test case by any chance?
[14 Sep 2010 8:55]
Esben Bast
I had the same problem, I fixed it by reordering the elements in my connection string. This is the one created by using the "MySQL Website configuration" tool, by clicking the "Edit" button on the first wizard step: ------- database=***; server=***; password=***; Uid=*** ------- The above did not work. But this one did: ------- server=***; User Id=***; password=***; database=*** ------- I also tried editing the first connection string (replacing "Uid" with "User Id") without any luck. So my guess is something about the order of the items in the connection string. *Setup* Development machine: Win XP SP3 32 bit Visual Studio 2010 Pro MySQL .net connector 6.3.4 (msi, typical) Remote MySQL server 5.1.48.
[14 Sep 2010 9:00]
Esben Bast
I hope I posted the above in the right place. I just found this bug report by a Google search, and thought my discovery might help others.
[30 Oct 2010 16:27]
Johan Tasanko
I had the problem that it did not work on my production server (Windows Server 2008R2 and IIS7, .NET framework 2.0) but it worked on my local development machine with Visual Studio 2008. This was the error message that I got on the production server: Server Error in '/' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unable to initialize provider. Missing or incorrect schema. Source Error: Line 49: <providers> Line 50: <clear /> Line 51: <add name="MySQLMembershipProvider" autogenerateschema="true" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.3.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /> Line 52: </providers> Line 53: </membership> Source File: C:\inetpub\testProject\web.config Line: 51 Version Information: Microsoft .NET Framework Version:2.0.50727.4206; ASP.NET Version:2.0.50727.4209 These are the steps that I took to make it work on my production server (not sure if all are needed). 0. Create the database. Do not add any tables, these will be added automatically later when you start the site. 1. Install MySQL Connector .NET. I used version 6.3.5.0. 2. Add "autogenerateschema="true"" to the tag starting with "<add name="MySQLMembershipProvider"" in section <membership> -> <providers> in file C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config. 3. Add the line <add type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.3.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> in the section TrustedProviders in file C:\Windows\System32\inetsrv\config\administration.config. 4. Set these settings in web.config (***=specific settings for your database). <configuration> <connectionStrings> <remove name="LocalMySqlServer"/> <add name="LocalMySqlServer" connectionString="server=***;uid=***;pwd=***;database=***;" providerName="MySql.Data.MySqlClient"/> </connectionStrings> <system.web> <profile> <providers> <clear/> <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.3.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" /> </providers> </profile> <roleManager> <providers> <clear/> <add name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.3.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" /> </providers> </roleManager> <membership defaultProvider="MySQLMembershipProvider"> <providers> <clear/> <add name="MySQLMembershipProvider" autogenerateschema="true" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.3.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /> </providers> </membership> </system.web> </configuration> 5. Use these settings for section "Providers" in IIS for your site: .NET Users = MySQLMembershipProvider .NET Roles = MySQLRoleProvider .NET Profile = MySQLProfileProvider 6. Start your site and enjoy! Other: 1. Also remember to check the connection string. I had the port number for the server and then it did not work. It did work when I remover port number. Message was then "Unable to initialize provider. Missing or incorrect schema.". E.g. server IP 167.167.7.16:3306 is with port number and IP 167.167.7.16 is without port number. 2. You might need to restart the IIS and/or the site after making changes. 3. When opening section ".NET Users" in IIS you will get message if providers are not correctly configured or if connection string to database is not correct.
[11 May 2011 16:18]
Julio Casal
The cause for this error is a duplicate of bug #44654. Please use the new patch and let me know if the issue persist.