Bug #106439 Error loading MySQL ODBC 8.0 Unicode Driver
Submitted: 11 Feb 2022 11:37 Modified: 3 Mar 2022 10:13
Reporter: Victor Friedman Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:8.0 OS:Windows (11)
Assigned to: CPU Architecture:Any
Tags: odbc connector 8

[11 Feb 2022 11:37] Victor Friedman
Description:
Using a connection script to ODBC connection with the following options:
DRIVER=MySQL ODBC 8.0 Unicode Driver;UID=_;PWD=_;NO_LOCALE=1;NO_PROMPT=1;MULTI_STATEMENTS=1;SSLMODE=PREFERRED;CHARSET=UTF8MB4;PORT=3306;DATABASE=_;SERVER=_;OPTION=_"

When initializing the connection, I get the following error:
Specified driver could not be loaded to due system error 126: The specified module could not be found. (MySQL ODBC 8.0 Unicode Driver, C:\Windows\SysWOW64\myodbc8w.dll).

I went to the directory and the myodbc8w.dll file is in place. So I'm puzzled as to why it says it cannot find it.

Now here is the interesting part. This happens ONLY on Windows 11, while on a Windows 10 system there is no such problem.
Also, if I use ANSI Driver instead of Unicode in this statement, everything loads without an error either on Win10 or Win 11, but then my data is garbled up.
So I need the Unicode driver to work on Windows 11.

How to repeat:
I'm using a rather old application (Visual Foxpro), so repeating this error would be challenging.
But I'm willing to assist in any way to fix the issue.
[17 Feb 2022 13:48] MySQL Verification Team
Hello Victor Friedman,

Thank you for the bug report.
Could you please answer the below questions?

1. What is the exact version of 8.0.x?
2. Why is the path for the driver C:\Windows\SysWOW64\myodbc8w.dll?
3. Why it wasn't installed in \Program Files (x86)\MySQL\Connector ODBC 8.0 , which is the default path MSI installer places the driver?

Also please note that, if you have just unpacked a zip package in SysWOW64, you have to make sure that all .dll files and sub-directories are unpacked there as well.
And please make sure that Visual C++ 32-bit redistributable package is installed on your windows machine.

Connector/ODBC 8.0.14 or higher: VC++ Runtime 2015 or VC++ Runtime 2017
Connector/ODBC 8.0.11 to 8.0.13: VC++ Runtime 2015

Regards,
Ashwini Patil
[17 Feb 2022 14:58] Victor Friedman
> 1. What is the exact version of 8.0.x?
8.0.28

> 2. Why is the path for the driver C:\Windows\SysWOW64\myodbc8w.dll?
I have no idea, but this file also exists in \Program Files (x86)\MySQL\Connector ODBC - the exact same file.

Installing VC++ redistributable didn't fix the problem.
[22 Feb 2022 11:38] MySQL Verification Team
Hello Victor Friedman,

Thank you for the requested details.

Try following
1. Remove C:\Windows\SysWOW64\myodbc8w.dll
2. Uninstall the driver
3. Install the driver from MSI again

Also, after this is done please create a data source in ODBC Administrator and test it.

Regards,
Ashwini Patil
[3 Mar 2022 10:04] Victor Friedman
It worked, thanks!
[3 Mar 2022 10:13] MySQL Verification Team
Thank you for confirming. Closing the report for now.
[25 May 2022 12:16] MySQL Verification Team
Bug #106674 marked as duplicate of this one.