MySQL ODBC 32对64位

时间:2010-03-04 18:54:48

标签: mysql 64-bit odbc 32-bit win64

我有一个32位应用程序,必须使用64位版本的MySQL在Windows x64服​​务器上运行 我应该使用32位ODBC驱动程序还是64位ODBC驱动程序? 或者我也应该安装32位版本的MySQL吗?

2 个答案:

答案 0 :(得分:6)

您需要安装一个32位SQL和ODBC驱动程序,看看您的应用程序是如何处理32位的。出于兼容性原因。

我还在搜索,会编辑。

**编辑

要解决此问题,请使用适当版本的ODBC Administrator工具。如果在64位操作系统上构建然后将应用程序作为32位应用程序运行,则必须使用%windir%\ SysWOW64 \ odbcad32.exe中的ODBC管理器工具创建ODBC数据源。要指示DSN的类型,可以将“_32”添加到32位用户DSN,将“_64”添加到64位用户DSN。

来自Microsoft support

**编辑

如果您想要解决方法,则需要使用中的管理工具创建ODBC数据源。 这也在同一链接中解释。

%windir%\SysWOW64\odbcad32.exe

答案 1 :(得分:4)

我能够

  1. 在Windows 64位上安装ODBC 32位

  2. 让我的应用程序(32位)运行 32位ODBC“对抗”64位很好 MySQL在64位Windows操作系统(2008 R2)

  3. 要实现1)我必须修改随MySQL ODBC的zip包提供的install.bat,以考虑必须在c:\windows\syswow64中安装32位驱动程序的事实。

    @ECHO OFF
    REM #########################################################
    REM
    REM \brief  Install myodbc.
    REM
    REM         This exists for those working with the Windows source
    REM         distribution.
    REM
    REM \sa     README.win
    REM
    REM #########################################################
    
    SET installdir=none
    IF EXIST %windir%\system\nul   SET installdir=%windir%\system
    IF EXIST %windir%\system32\nul SET installdir=%windir%\system32
    
    REM ****************************
    REM * check syswow64 folder too ...
    REM ****************************
    IF EXIST %windir%\syswow64\nul SET installdir=%windir%\syswow64
    
    IF %installdir%==none GOTO :doError5
    
    
    IF "%1"=="1" GOTO :doDebug
    IF "%1"=="0" GOTO :doNormal
    GOTO doSyntax
    
    :doNormal
    
    REM ****************************
    REM * syswow64 must be specified
    REM ****************************
    IF EXIST %installdir%\myodbc3i.exe GOTO :doError4
    
    REM ****
    REM * Find out the bin/lib directory, or use default
    REM ****
    SET libdir=lib
    SET bindir=bin
    IF EXIST lib\release\myodbc3.lib         SET libdir=lib\release
    IF EXIST lib\relwithdebinfo\myodbc3.lib  SET libdir=lib\relwithdebinfo
    IF EXIST bin\release\myodbc3i.exe        SET bindir=bin\release
    IF EXIST bin\relwithdebinfo\myodbc3i.exe SET bindir=bin\relwithdebinfo
    
    REM ****
    REM * Copying myodbc libraries and executables to install dir...
    REM ****
    IF NOT EXIST %bindir%\myodbc3c.exe GOTO :doError2
    IF NOT EXIST %libdir%\myodbc3.lib  GOTO :doError2
    IF NOT EXIST %libdir%\myodbc3S.lib GOTO :doError2
    IF NOT EXIST %bindir%\myodbc3i.exe GOTO :doError2
    IF NOT EXIST %bindir%\myodbc3m.exe GOTO :doError2
    copy %libdir%\myodbc3S.dll %installdir%
    copy %libdir%\myodbc3S.lib %installdir%
    copy %libdir%\myodbc3.dll  %installdir%
    copy %libdir%\myodbc3.lib  %installdir%
    copy %bindir%\myodbc3i.exe      %installdir%
    copy %bindir%\myodbc3m.exe      %installdir%
    copy %bindir%\myodbc3c.exe      %installdir%
    copy doc\*.hlp             %installdir%
    
    REM ****
    REM * Registering driver...
    REM *
    REM * We can do this with myodbc3i.exe or the MS Windows ODBCConf.exe. It
    REM * may be safer to use the ODBCConf.exe when we think about such things
    REM * as 64bit windows.
    REM ****
    
    REM ****************************
    REM * syswow64 must be specified
    REM ****************************
    %installdir%\myodbc3i -a -d -t"MySQL ODBC 3.51 Driver;DRIVER=%installdir%\myodbc3.dll;SETUP=%installdir%\myodbc3S.dll"
    
    GOTO doSuccess
    
    :doDebug
    REM ****
    REM * Find out the bin/lib directory, or use default
    REM ****
    SET libdir=lib
    IF EXIST lib\debug\myodbc3d.lib          SET libdir=lib\debug
    
    IF NOT EXIST %libdir%\myodbc3d.lib goto doError3
    IF NOT EXIST %libdir%\myodbc3E.lib goto doError3
    IF NOT EXIST %installdir%\myodbc3i.exe goto doError1
    REM ****
    REM * Copying myodbc debug libraries to install dir...
    REM ****
    copy %libdir%\myodbc3E.dll %installdir%
    copy %libdir%\myodbc3E.lib %installdir%
    copy %libdir%\myodbc3d.dll %installdir%
    copy %libdir%\myodbc3d.lib %installdir%
    
    REM ****
    REM * Registering driver...
    REM ****
    
    REM ****************************
    REM * syswow64 must be specified
    REM ****************************
    %installdir%\myodbc3i -a -d -t"MySQL ODBC 3.51 Driver (debug);DRIVER=myodbc3d.dll;SETUP=myodbc3E.dll"
    
    goto doSuccess
    
    
    :doSuccess
    ECHO "+-----------------------------------------------------+"
    ECHO "| DONE                                                |"
    ECHO "+-----------------------------------------------------+"
    ECHO "|                                                     |"
    ECHO "| Hopefully things went well; the Connector/ODBC      |"
    ECHO "| files have been copied to the system directory      |"
    ECHO "| and the driver has been registered.                 |"
    ECHO "|                                                     |"
    ECHO "| Connector/ODBC is ready to use.                     |"
    ECHO "|                                                     |"
    ECHO "| The most common thing to do next is to go to the    |"
    ECHO "| Control Panel and find the ODBC Administrator -     |"
    ECHO "| then use it to create a Data Source Name (DSN)      |"
    ECHO "| so you (and your application) can connect to a      |"
    ECHO "| MySQL server.                                       |"
    ECHO "|                                                     |"
    ECHO "+-----------------------------------------------------+"
    EXIT /B 0
    
    :doError1
    ECHO "+-----------------------------------------------------+"
    ECHO "| ERROR                                               |"
    ECHO "+-----------------------------------------------------+"
    ECHO "|                                                     |"
    ECHO "| The non-debug version of Connector/ODBC needs to be |"
    ECHO "| installed.                                          |"
    ECHO "|                                                     |"
    ECHO "+-----------------------------------------------------+"
    PAUSE
    EXIT /B 1
    
    :doError2
    ECHO "+-----------------------------------------------------+"
    ECHO "| ERROR                                               |"
    ECHO "+-----------------------------------------------------+"
    ECHO "|                                                     |"
    ECHO "| Connector/ODBC not built. Consider executing        |"
    ECHO "| Build.bat.                                          |"
    ECHO "|                                                     |"
    ECHO "+-----------------------------------------------------+"
    PAUSE
    EXIT /B 1
    
    :doError3
    ECHO "+-----------------------------------------------------+"
    ECHO "| ERROR                                               |"
    ECHO "+-----------------------------------------------------+"
    ECHO "|                                                     |"
    ECHO "| Connector/ODBC (debug) not built. Consider executing|"
    ECHO "| Build.bat.                                          |"
    ECHO "|                                                     |"
    ECHO "+-----------------------------------------------------+"
    PAUSE
    EXIT /B 1
    
    :doError4
    ECHO "+-----------------------------------------------------+"
    ECHO "| ERROR                                               |"
    ECHO "+-----------------------------------------------------+"
    ECHO "|                                                     |"
    ECHO "| Existing Connector/ODBC installed. Request ignored. |"
    ECHO "|                                                     |"
    ECHO "+-----------------------------------------------------+"
    PAUSE
    EXIT /B 1
    
    :doError5
    ECHO "+-----------------------------------------------------+"
    ECHO "| ERROR                                               |"
    ECHO "+-----------------------------------------------------+"
    ECHO "|                                                     |"
    ECHO "| Can't find the Windows system directory             |"
    ECHO "|                                                     |"
    ECHO "+-----------------------------------------------------+"
    PAUSE
    EXIT /B 1
    
    :doSyntax
    ECHO "+-----------------------------------------------------+"
    ECHO "| Install.bat                                         |"
    ECHO "+-----------------------------------------------------+"
    ECHO "|                                                     |"
    ECHO "| DESCRIPTION                                         |"
    ECHO "|                                                     |"
    ECHO "| Use this to copy the driver and supporting files    |"
    ECHO "| to the system directory and register the driver.    |"
    ECHO "|                                                     |"
    ECHO "| You can not properly install the debug version      |"
    ECHO "| without first installing the regular version.       |"
    ECHO "|                                                     |"
    ECHO "| SYNTAX                                              |"
    ECHO "|                                                     |"
    ECHO "| Install <debug>                                     |"
    ECHO "|                                                     |"
    ECHO "| <debug>  must be;                                   |"
    ECHO "|              0 - to install a regular build         |"
    ECHO "|              1 - to install a debug version         |"
    ECHO "|                                                     |"
    ECHO "+-----------------------------------------------------+"