Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

ODBC Problem with mongoDB BI connector (MySQL)

Hi everybody.

Since 1 month, I am not able to load more than 500,000 (I have 590,000 more or less) lines from MongoDB using the ODBC connector. Let me explain: I use the lastest release of MongoDB 3.6 and I have installed the MongoDB BI connector, that means, I use the ODBC option of PowerBI to get data, as the Mongo BI connector fakes a MySQL ODBC connection.

The last 4 months, all went smoothly and I was able to load my 4,000,000 lines from MongoDB, but this month, the Refresh Data gives me an error (ODBC Driver Error) at the end of the import. That is to say, it reads all the lines, but when it finishes, it just crashes.

 

The Error is:

Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error[DataSource.Error] ODBC: ERROR [22018][MySQL][ODBC 5.3 (a) Driver][mysqld-5.7.12 mongosqld v2.4.1].'.

 

Digging a bit, the ODBC error 22018 seems to be 2invalid character value for cast specification"...

The very strange thing is that when I try this using Excel: conecting to the exact same DSN, importing the exact same table, it reads the 590,000 lines without problem.

I have tested in PowerBI, it works for 480,000 lines but crashes for 590,000.

I have no idea about what could be the problem, and why it worked for 4,000,000 the last months.

 

Considering the type of the error, I don't really know if the number of lines is the cause of the problem...

 

Thanks!

  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi Lydia.

    Indeed, I found the solution. And it is related to character encoding.

    MySQL provides 2 ODBC drivers, ANSI driver and the Unicode driver. In the MongoDB documentiation, they advise to use the ANSI driver, but this is what provoques the error.

    It seems to work fine with the Unicode Driver.

     

    Thanks for your answer!

10 Replies

  • Hello there,

    I got this same issue, and also tried with both options (ANSI - unicode), someone have solved in other way?

    thanks a lot!

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous,

    The above error is related to collation on MongoDB, what is the collation of your query? Do you have any foreign characters in the MongoDB data source?

    Regards,
    Lydia

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Lydia.

      Indeed, I found the solution. And it is related to character encoding.

      MySQL provides 2 ODBC drivers, ANSI driver and the Unicode driver. In the MongoDB documentiation, they advise to use the ANSI driver, but this is what provoques the error.

      It seems to work fine with the Unicode Driver.

       

      Thanks for your answer!

      • Anonymous's avatar
        Anonymous
        Not applicable

        I'm able to connect to MongoDB, but while browsing through the tables in "Navigator" it is throwing the below error message:

         

        DataSource.Error: ODBC: ERROR [HY000] [MySQL][ODBC 1.2(w) Driver][mysqld-5.7.12 mongosqld v2.12.0]Unknown database ''

        Details:
        DataSourceKind=Odbc
        DataSourcePath=dsn=B1 Unicode DSN
        OdbcErrors=Table

         

        Tried with both drivers ANSI and Unicode. Kindly help.

  • Anonymous's avatar
    Anonymous
    Not applicable

    I'm facing the exact same error that MuthuLakshmi mentioned in the above comments and I've tried both the drivers still facing the same issue. I've wasted 2 days and found nothing, can somebody help?

     

    Muthulakshmi-

    "I'm able to connect to MongoDB, but while browsing through the tables in "Navigator" it is throwing the below error message:

     

    DataSource.Error: ODBC: ERROR [HY000] [MySQL][ODBC 1.2(w) Driver][mysqld-5.7.12 mongosqld v2.12.0]Unknown database ''

    Details:
    DataSourceKind=Odbc
    DataSourcePath=dsn=B1 Unicode DSN
    OdbcErrors=Table

     

    Tried with both drivers ANSI and Unicode. Kindly help."

     

    TIA

    Varun

  • Anonymous's avatar
    Anonymous
    Not applicable

    This issue continues i dont have answer:

     

  • baki88epj's avatar
    baki88epj
    Regular Visitor

    In my case, and I hope this helps also other users, I fixed this errore by changing this setting in the connection panel.

    It works both wih unicode and ansi drivers.