Difference between revisions of "MyODBC connector"
m (→Version 3.51) |
m (→Setting up an ODBC DSN) |
||
Line 51: | Line 51: | ||
</source> | </source> | ||
− | == Setting up an ODBC DSN == | + | == Setting up an ODBC User DSN == |
=== Version 5.1 === | === Version 5.1 === | ||
Line 62: | Line 62: | ||
HKCU\Software\ODBC\ODBC.INI\<connection name>\SERVER <server> REG_SZ | HKCU\Software\ODBC\ODBC.INI\<connection name>\SERVER <server> REG_SZ | ||
HKCU\Software\ODBC\ODBC.INI\<connection name>\UID <username> REG_SZ | HKCU\Software\ODBC\ODBC.INI\<connection name>\UID <username> REG_SZ | ||
+ | |||
+ | === Version 3.51 === | ||
+ | |||
+ | HKCU\Software\ODBC\ODBC.INI\ODBC Data Sources\<connection name> REG_SZ MySQL ODBC 3.51 Driver | ||
+ | HKCU\Software\ODBC\ODBC.INI\<connection name>\DATABASE <database> REG_SZ | ||
+ | HKCU\Software\ODBC\ODBC.INI\<connection name>\Driver %WINDIR%\system32\myodbc3.dll REG_SZ | ||
+ | HKCU\Software\ODBC\ODBC.INI\<connection name>\PORT 3306 REG_SZ | ||
+ | HKCU\Software\ODBC\ODBC.INI\<connection name>\PWD <password> REG_SZ | ||
+ | HKCU\Software\ODBC\ODBC.INI\<connection name>\SERVER <server> REG_SZ | ||
+ | HKCU\Software\ODBC\ODBC.INI\<connection name>\UID <username> REG_SZ | ||
+ | |||
+ | == Setting up an ODBC System DSN == | ||
+ | |||
+ | === Version 5.1 === | ||
dummy.reg is HKLM\SOFTWARE\ODBC\ODBC.ini\dummy exported via regedit on a machine with the appropriate DSN defined. | dummy.reg is HKLM\SOFTWARE\ODBC\ODBC.ini\dummy exported via regedit on a machine with the appropriate DSN defined. | ||
Line 79: | Line 93: | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Reg.exe for Windows 2000 === | === Reg.exe for Windows 2000 === |
Revision as of 15:08, 26 August 2009
This is a silent installer and uninstaller for MySQL Connector/ODBC (once known as MyODBC).
MySQL Connector/ODBC allows Windows programs, for example OpenOffice, to connect to a remote MySQL database, for example on an office server.
MySQL Connector/ODBC can be dowloaded from http://www.mysql.com/products/connector/odbc/.
Contents
MySQL Connector/ODBC 3
For ODBC connections to MySQL versions prior to 5.1?
MSI Installer
<package id="myodbc" name="MyODBC connector" revision="1" reboot="false" priority="0" >
<check type="uninstall" condition="exists" path="MySQL Connector/ODBC 3.51" />
<install cmd='msiexec /passive /i "%SOFTWARE%\myodbc\myodbc-3.51.26-win32.msi"' />
<remove cmd="MsiExec.exe /qb /uninstall {0CB3C535-1171-4A20-B549-E2CB5DEB9723}" />
</package>
.exe Installer
<package id="myodbc" name="MyODBC connector" revision="1" reboot="false" priority="0" >
<check type="uninstall" condition="exists" path="MySQL Connector/ODBC 3.51" />
<install cmd="%SOFTWARE%\myodbc\myodbc-3.51.26.exe /s" />
<remove cmd="%windir%\system32\unwise.exe /S %windir%\system32\myodbc3_install.log" />
</package>
MySQL Connector/ODBC 5.1
For ODBC connections to MySQL version 5.1?
<package id="myodbc" name="MyODBC connector" revision="3" reboot="false" priority="5" >
<check type="uninstall" condition="exists" path="MySQL Connector/ODBC 5.1" />
<install cmd="msiexec /qn /i %SOFTWARE%\myodbc\mysql-connector-odbc-5.1.5-win32.msi " />
<upgrade cmd="msiexec /qn /i %SOFTWARE%\myodbc\mysql-connector-odbc-5.1.5-win32.msi " />
<remove cmd="msiexec /qn /x{29042B1C-0713-4575-B7CA-5C8E7B0899D4}" />
</package>
If you were beta testing earlier 5.1 versions prior to 5.1.5
install/upgrade of 5.1.5 fails if earlier (eg 5.1.4) version is installed, so we do a remove first by adding these:
<install cmd="msiexec /qn /x{29042B1C-0713-4575-B7CA-5C8E7B0899D4}" ><exit code="0"/><exit code="1605" /></install>
<upgrade cmd="msiexec /qn /x{29042B1C-0713-4575-B7CA-5C8E7B0899D4}" ><exit code="0"/><exit code="1605" /></upgrade>
Setting up an ODBC User DSN
Version 5.1
HKCU\Software\ODBC\ODBC.INI\ODBC Data Sources\<connection name> REG_SZ MySQL ODBC 5.1 Driver HKCU\Software\ODBC\ODBC.INI\<connection name>\DATABASE <database> REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\Driver C:\Program Files\MySQL\Connector ODBC 5.1\myodbc5.dll REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\PORT 3306 REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\PWD <password> REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\SERVER <server> REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\UID <username> REG_SZ
Version 3.51
HKCU\Software\ODBC\ODBC.INI\ODBC Data Sources\<connection name> REG_SZ MySQL ODBC 3.51 Driver HKCU\Software\ODBC\ODBC.INI\<connection name>\DATABASE <database> REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\Driver %WINDIR%\system32\myodbc3.dll REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\PORT 3306 REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\PWD <password> REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\SERVER <server> REG_SZ HKCU\Software\ODBC\ODBC.INI\<connection name>\UID <username> REG_SZ
Setting up an ODBC System DSN
Version 5.1
dummy.reg is HKLM\SOFTWARE\ODBC\ODBC.ini\dummy exported via regedit on a machine with the appropriate DSN defined.
<package id="mysql_dummy" name="My Dummy ODBC Connection" revision="2" reboot="false" priority="4" >
<depends package-id="myodbc" />
<depends package-id="reg" /> <!-- Windows 2000 doesn't come with reg.exe, hence this dependency -->
<check type="registry" condition="exists" path="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\dummy" />
<install cmd="regedit /s %SOFTWARE%\myodbc\dummy.reg " />
<install cmd='reg.exe add "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC DATA SOURCES" /v dummy /t REG_SZ /d "MySQL ODBC 5.1 Driver" /f ' />
<upgrade cmd="regedit /s %SOFTWARE%\myodbc\dummy.reg " />
<upgrade cmd='reg.exe add "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC DATA SOURCES" /v dummy /t REG_SZ /d "MySQL ODBC 5.1 Driver" /f ' />
<remove cmd="reg.exe del HKLM\SOFTWARE\ODBC\ODBC.INI\dummy /f" />
<remove cmd='reg.exe del "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC DATA SOURCES" /v dummy /f ' />
</package>
Reg.exe for Windows 2000
reg.exe isn't bundled with Windows 2000 by default, it is only available as a download or as part of the Windows 2000 Resource Kit. This copies reg.exe into place so it can be used in the above:
<package id="reg" name="Reg.exe" revision="1" reboot="false" priority="99" >
<check type="file" condition="exists" path="%WINDIR%\system32\reg.exe" />
<install cmd='xcopy /Q /R /Y "%SOFTWARE%\reg.exe" "%WINDIR%\system32\" ' />
</package>
Mysql Tools 5.0
<package id="mysql_gui_tools" name="MyODBC GUI Tools" revision="1" reboot="false" priority="4" >
<check type="uninstall" condition="exists" path="MySQL Tools for 5.0" />
<install cmd="msiexec /qn /i %SOFTWARE%\myodbc\mysql-gui-tools-5.0-r17-win32.msi " />
<upgrade cmd="msiexec /qn /i %SOFTWARE%\myodbc\mysql-gui-tools-5.0-r17-win32.msi " />
<remove cmd="msiexec /qn /x{FCB10DE3-E190-4A7E-B06A-FAC61567ABFC}" />
</package>