October 24, 2022 at 12:51 pm
I have a database in MySQL 5.7 that I need to link to a DB in SQLEXPRESS so that I can selectively migrate data. The MySQL server is 64-bit. Whenever I try to install 32-bit MySQL Connector/ODBC 8.0, and set the MYSQL up as a 32-bit System DSN on the machine with SQLExpress and SSMS installed and set up and test the connection, I get 'Connection successful'. If I try to set it up as a linked server in SSMS (18.12.1), it fails with a string of error messages, and somewhere in there it says something about an architecture mismatch.
On the other hand, if I install the 64-bit Connector and try to set up a 64-bit System DSN, I get "Connection failed with the following error:
[MySQL][ODBC 8.0(a) Driver]String data, right truncated.[01004]"
October 25, 2022 at 1:10 pm
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
October 26, 2022 at 4:25 pm
Did some searching around based on my knowledge of SQL Server and MySQL. Found the following post in a thread. It is taken from a Microsoft article for the MySQL ODBC driver. The linked article at the end of the post may be of some use to you: (The error is a conversion problem between MySQL and SQL Server because of the way they handle string lengths and apparently it is a known issue with the driver. Though I don't know what system OS you are running the MYSQL server in, this article may still give you some good leads as to how to get around the problem):
---------------
"This is a known issue of the mssql ODBC driver. According to the Microsoft blog post:
The ColumnSize parameter of SQLBindParameter refers to the number of characters in the SQL type, while BufferLength is the number of bytes in the application's buffer. However, if the SQL data type is varchar(n) or char(n), the application binds the parameter as SQL_C_CHAR or SQL_C_VARCHAR, and the character encoding of the client is UTF-8, you may get a "String data, right truncation" error from the driver even if the value of ColumnSize is aligned with the size of the data type on the server. This error occurs since conversions between character encodings may change the length of the data. For example, a right apostrophe character (U+2019) is encoded in CP-1252 as the single byte 0x92, but in UTF-8 as the 3-byte sequence 0xe2 0x80 0x99.
You can find the full article here."
October 26, 2022 at 8:06 pm
It's all on Windows, so I'm not sure that applies...
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply