MySQL install problem

Topics: ASP.NET 2.0
Jan 19, 2009 at 10:41 PM
Hi folks,

I'm getting the below error when trying to run my BE with MySQL (my server is running 5.0.46 MySQL rather than 5.1.6.0 as original source contains).

Any ideas of what I need to do in order to get this to work? From the info it looks like something isn't set up for the MySQL on my .NET solution but I can't tell what when it simply tells me to enable error logging.

Many thanks

Ragnar

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: Could not load file or assembly 'MySql.Data, Version=5.0.46, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 49: 		<compilation debug="true">
Line 50: 			<assemblies>
Line 51:         <add assembly="MySql.Data, Version=5.0.46, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
Line 52: 				<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line 53: 				<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

Source File: D:\home\mywebsite.com\wwwroot\news\web.config    Line: 51

Assembly Load Trace: The following information can be helpful to determine why the assembly 'MySql.Data, Version=5.0.46, Culture=neutral, PublicKeyToken=c5687fc88969c44d' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Jan 25, 2009 at 4:09 PM
First, go here and download your preference of driver:

http://dev.mysql.com/downloads/#connector-net

Then either add the project to VS and/or add a reference to the mysql.data project or dll.

Next, in the web.config, delete the areas highlighted in red.

<system.data>
    <DbProviderFactories>
      <clear />
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient"
           description=".Net Framework Data Provider for MySQL"
           type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data ,
               Version=5.1.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d
" />
    </DbProviderFactories>
  </system.data>
  <system.web>
        <compilation debug="true">
            <assemblies>
        <add assembly="MySql.Data, Version=5.1.6.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
                <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
        </compilation>