Upstream is failing since it's only looking in HKEY_USER, and your code isn't correcting that. My registry the the following. HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\MySQL ODBC 8.0 Unicode Driver Have a look at the mysql code (function Driver::lookup), its queries the registry to find the driver and when SQLGetPrivateProfileStringW fails produces the follow error. 0120:fixme:odbc:SQLPostInstallerErrorW 7 L"Cannot find driver" .. aka SQLPostInstallerErrorW(ODBC_ERROR_INVALID_NAME, W_CANNOT_FIND_DRIVER) (MYSQL source). We could check if the drivers under "HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers" first, and default to HKEY_LOCAL_MACHINE in that case. After looking in the registry ODBCINST.INI = Driver information ODBC.INI = DSN information. For ODBCINST.INI, default to both? The mysql seem to restore config_mode after calling SQLGetPrivateProfileStringW, suggesting that the code_mode might change internally. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6278#note_78805