安裝MySQL ODBC驅動出現Error 1918的解決方法

最近進行Microsoft SQL Server利用Link Server對接老舊的MySQL時,因為種種限制只能安裝比較舊版的MySQL ODBC Driver,沒想到在安裝的時候連這麼簡單的東西都會報錯!

MySQL ODBC Driver: Error 1918

安裝過程中出現這種寫得不明不白的錯誤(還有很多資訊被隱藏起來),說實話蠻令人無言的,錯誤的圖片如下:

不同的MySQL ODBC Driver版本會有不同的錯誤,例如5.1跟5.3就不一樣,我把資訊謄寫在下方以利GOOGLE搜尋索引:

MySQL ODBC Driver version 5.1

Error 1918. Error installing ODBC driver MySQL ODBC 5.1 Driver, ODBC error 13: The setup routines for the MySQL ODBC 5.1 Driver could not be loaded due to system error code 126: The specified module could not be found.  ...\myodbc5S.dll). Verify that the file MySQL ODBC 5.1 Driver exists and that...

MySQL ODBC Driver version 5.3

Error 1918. Error installing ODBC driver MySQL ODBC 5.3 ANSI Driver, ODBC error 13: The setup routines for the MySQL ODBC 5.3 ANSI Driver ODBC driver could not be loaded due to system error code 126: The specified module could not be found. ...myodbc5S.dll...

解決辦法

答案就是先安裝對應的Visual C++ Redistributable Package後,再安裝MySQL ODBC Driver即可。

  1. 5.1版本解藥:Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package MFC Security Update.zip
  2. 5.3版本解藥:Microsoft Visual C++ Redistributable Packages for Visual Studio 2013.zip
無法載入 ODBC驅動程式的設定常式 系統錯誤碼 找不到指定的模組