Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
khoibui
New Member

MySQL connector: value "preferred"is not the correct type

Hello,

 

I have an issue with using Power BI to connect to a MySQL instance (without SSL encryption)

 

Power BI: Version: 2.57.5068.721 64-bit (April, 2018)

MySQL connector NET: 8.0.11

 

Error message:

 

Unable to connect

We encountered an error while trying to connect.

Details: "value 'preferred' is not the correct type."

 

Have anyone encountered this or know of a solution? I've tried to install different version of MySQL connector NET package but no luck. 

I'm able to connect via MySQL workbench

1 ACCEPTED SOLUTION
kpriemer
New Member

I had the same issue. I downgraded the mysql connector to 6.10.6 and then it workeded.

View solution in original post

4 REPLIES 4
kpriemer
New Member

I had the same issue. I downgraded the mysql connector to 6.10.6 and then it workeded.

Thank you! Downgrading also worked for me.

Hello,

I have installed the My SQL Connector 6.10.6 as mentioned in the message. I was able to connect to the server and created the dashboard. When i tried to schedule refresh in Power BI report Server getting the below error message.

 

 

Power BI  Server Version : Version 1.2.6660.39920 (Build 15.0.2.389), March 2018

 

 

"Status: Error Failed Data Refresh, Exception Microsoft.AnalysisServices.OperationException: Failed to save modifications to the server. Error returned: 'MySQL: We were unable to find a database provider with invariant name 'MySql.Data.MySqlClient'.
This error could've been the result of provider-specific client software being required, but missing on this computer.  To download client software for this provider, visit the following site and choose the 64-bit (x64) version of, at minimum, 'MySQL Connector/Net': https://go.microsoft.com/fwlink/?LinkId=278885. The exception was raised by the IDbCommand interface.
The current operation was cancelled because another operation in the transaction failed.
The command has been canceled.. The exception was raised by the IDbCommand interface.
The command has been canceled.. The exception was raised by the IDbCommand interface.
'.
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.ExecuteActionWithLogging(Action methodToExecute, String description, String localizedDescription, String messageInFailure, RefreshInfo refreshInfo, DataAccessors dataAccessors, ReportEventType operation, Boolean isDataRetrieval, Boolean showInExecutionLog, Boolean sendToTelemetry)
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.AnalysisServicesDataRefresh.RefreshData(RefreshInfo refreshInfo)
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.<>c__DisplayClass9.<ExecuteActionWithLogging>b__7()
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.<ExecuteFuncWithLogging>d__3`1.MoveNext()"

 

This solution worked for me as well.

 

Is there a reason why the latest version of the MySQL Connector/NET is causing this failure:

Value 'Preferred' is not of the correct type

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors