Issues with MySQL .NET Connector Installation

Hi everyone!

I’m facing challenges while trying to connect to my MySQL database after installing the MySQL .NET Connector. When I choose the “Get data from other sources” option, select “MySQL database”, I encounter an error that states “This connector requires one or more additional components to be installed before it can be used”.

I have confirmed that I installed the MySQL .NET Connector from the official MySQL download site. To check if the installation is correct, I tried running a PowerShell command:

[System.Data.Common.DbProviderFactories]::GetFactoryClasses()|Out-GridView

Unfortunately, this command generates an error:

Exception calling "GetFactoryClasses" with "0" argument(s): "Failed to create configuration section handler for system.data: The column 'InvariantName' must be unique. The value 'MySql.Data.MySqlClient' is already present. (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config line 157)"
At line:1 char:1
+ [System.Data.Common.DbProviderFactories]::GetFactoryClasses()|Out-GridView
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ConfigurationErrorsException

I’m using version 9.1.0 of the MySQL .NET Connector and also tried it with PowerBI version 2.130.930.0. The same issue appears with later updates.

Could anyone suggest possible configuration adjustments that might resolve this problem?

This duplicate InvariantName error usually comes from registry corruption when you install multiple connectors. I’ve seen it tons of times when people upgrade MySQL connectors without cleaning up first. Use the MySQL Installer for Windows instead of the standalone connector - it’s way more reliable at handling registration. Before you reinstall anything, run a registry cleaner to get rid of orphaned MySQL entries, especially in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v4.0.30319\AssemblyFoldersEx. Also check that your PowerBI version actually supports the connector you’re installing - newer connectors can clash with older PowerBI versions. The machine.config fix works, but the official installer is less likely to create new problems.

Had the exact same problem! First, uninstall all MySQL connectors through Control Panel, then manually delete any leftover files in Program Files/MySQL. After that, do a clean install but run the installer as admin. The connector won’t register properly without admin rights and that’s what causes the duplicate entry issue.

This error occurs due to multiple MySQL connector installations conflicting within the machine.config file. I encountered a similar situation previously while switching between connector versions. To resolve this, edit the machine.config file directly. Navigate to C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\ and open machine.config as administrator. Look for duplicate entries of ‘MySql.Data.MySqlClient’ in the system.data section and remove the older ones, retaining only the latest version. After that, restart your system and rerun the PowerShell command. It’s also crucial to completely uninstall any outdated MySQL connector versions before installing new ones, as partial removals often leave behind registry entries that can lead to these conflicts.