Forum Discussion

guro2525's avatar
guro2525
Helper I
3 years ago

MySQL Connector NET doesn't working

Hello Dear friends,

 

I have a next problem:  I didn't manage to get data from a database. This happened after changing the database server and a database version. Before changing everything work fine, it was "MariaDB 10.5", after changing become MariaDB 10.11.

If I try to create a new connection I get an error:

--We encountered an error while trying to connect. Details: “An error happened while reading data from the provider: ‘Object cannot be cast from DBNull to other types.’”--

If I try to refresh an existing connection I get some errors:

--DataSource.Error: An error happened while reading data from the provider: 'Object cannot be cast from DBNull to other types.'--

--DataSource.Error: An error happened while reading data from the provider: 'The given key was not present in the dictionary.'--(If there are some steps in Power Query).

 

I have a last version of  Power Bi, I can connect to the database through MySQL Workbench 8.0 CE without any problem.

I think that problem may be MySQL Connector NET 8.0.32, it's not a last version, last version is MySQL Connector NET 8.0.33, but it doesn't work.

Using last version of the this software, I get an next error:

--This connector requires one or more additional components to be installed before it can be used.

 

Microsoft Powe Bi didn't manage to help me, may somebody had appropriate experience an dcan help me.

Thank you so much.

 

Best Regards,

Guram

15 Replies

  • Have you considered using the MariaDB driver instead of the MySQL driver?

    • guro2525's avatar
      guro2525
      Helper I

      Hello lbendlin ,

      Thank you so much for your response.
      I've tried this method and it really works!

      Unfortunatelly, MariaDB ODBC Connector doesn't have an advnace option where you can use SQL Statemnet (Custom Query).

      Do you have any idea how to solve this?
      I reaaly need ti because I use sutom queris 😞

      • ghaani's avatar
        ghaani
        Regular Visitor

        Hi. I,ve the same problem .Colud you find any solution for your problem ? 

  • Hi guro2525 ,

    For the problem " last version is MySQL Connector NET 8.0.33, but it doesn't work." It's a known issue from Oracle side. Oracle made a change, and that version does not correctly register itself on the system when you install it.

    Please try the solution in this similar thread: 

    powerbi - Power BI missing MySQL Connector, even though I installed it - Stack Overflow

     

    Best regards,

    Community Support Team_yanjiang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • lbendlin's avatar
      lbendlin
      Super User

      Wow, this is still an issue after all this time? Good thing we stayed on 8.0.28 ...

    • guro2525's avatar
      guro2525
      Helper I

      Hello v-yanjiang-msft!,

      Thank you so much for your response!
      Your solution solve this problem, but  using previous version I had another error:

      --We encountered an error while trying to connect. Details: “An error happened while reading data from the provider: ‘Object cannot be cast from DBNull to other types.’”--

      May be you have any experience how to solve this problem?


      Best Refards,
      Guram

      • lbendlin's avatar
        lbendlin
        Super User

        Rewrite your custom query to avoid the casting.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello, I have the same problem

    Finally, did you found a solution?

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi 
    Am facing the same issue now, could you help me what the possible options we have to resolve this issue