Delphi XE2 dbExpress MySQL 连接
无论我尝试什么,我都无法让 XE2 使用 dbExpress 连接到 MySQL。这个问题实际上有很多方面。首先,目标MySQL是32位或64位,这会影响MySQL安装附带的libmysql.dll,这似乎具有误导性,因为XE2 IDE是32位应用程序,它只接受32位DLL。所以我需要使用32位安装libmysql.dll,将其放在Windows\System32下(或者到项目本身的文件夹中),然后在我的项目中将Target编译平台设置为32位(这样就不会尝试使用 64 位 dbxmys.dll,以防万一),但仍然没有运气。我尝试的所有组合都会出现此错误:“DBX 错误:驱动程序无法正确初始化。客户端库可能丢失......”
任何人都能够使 XE2 dbExpress 连接到 MySQL 服务器吗?我需要你的帮助。提前致谢。
Windows 7 64 位(使用 XE2 的开发平台)、MySQL 5.5.16 32 位(安装在远程 XP 32 位上)/MySQL 5.1.54 64 位(安装在远程 XP x64 上)(都尝试过,通过使用他们的 libmysql.dll)
No matter what I've tried, I couldn't make XE2 to connect to a MySQL with dbExpress. The problem has actually many faces. First, target MySQL is either 32- or 64-bits, which affects the libmysql.dll that comes with the MySQL installation, which seems to be misleading because XE2 IDE is a 32-bit application and it only accepts 32-bit DLLs. So I needed to use a 32-bit installation libmysql.dll, put it under Windows\System32 (or to the project's folder itself), and then set the Target compile platform to 32-bit in my project (so that it won't try to use 64-bit dbxmys.dll, just in case), still with no luck. All the combinations I tried resulted with this error: "DBX Error: Driver could not be properly initialized. Client library may be missing......."
Anyone who's able to make XE2 dbExpress connect to a MySQL server? I need your help. Thanks in advance.
Windows 7 64-bit (dev platform with XE2), MySQL 5.5.16 32-bit (installed on a remote XP 32-bit) / MySQL 5.1.54 64-bit (installed on a remote XP x64) (tried with both, by using their libmysql.dlls)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
你的问题的答案很简单,安装你的mysql并从你的mysql bin复制libmysql.dll,如图所示。(C:\Program Files\MySQL\MySQL Server 5.1\bin)然后转到xe2目录并打开bin例如(C:\ Program Files \ Embarcadero \ RAD Studio \ 9.0 \ bin)并将其粘贴到那里运行已经存在的libmysql.dll。
the answer to your question is simple, install your mysql and copy libmysql.dll from your mysql bin as shown eg.(C:\Program Files\MySQL\MySQL Server 5.1\bin) and then go to the xe2 directory and open the bin too eg (C:\Program Files\Embarcadero\RAD Studio\9.0\bin) and paste it there over running the already libmysql.dll in it.
由于您似乎使用的是 x64 Windows,因此您应该将 x32
libmysql.dll
放入Windows\SysWOW64
,而不是Windows\System32
中。或者您可以将 x32libmysql.dll
放入XE2\Bin
文件夹中。如果您要构建 x64 应用程序,则应将 x64
libmysql.dll
放入Windows\System32
或 EXE 文件夹中。As it seems you have x64 Windows, then you should put x32
libmysql.dll
not intoWindows\System32
, but intoWindows\SysWOW64
. Or you can put x32libmysql.dll
intoXE2\Bin
folder.If you will build x64 application, then x64
libmysql.dll
you should put intoWindows\System32
or into your EXE folder.这个问题的答案可以在 WiltonSoftware.com。
我所做的是:
它对我来说工作得很好!
The answer for this question is found at WiltonSoftware.com.
What I did was:
It worked fine to me!
有点晚了,但我希望它有帮助:
我无法查明其工作的确切原因。可能是使用 sqlncli.dll 而不是 oledb.dll。
A bit late, but I hope it helps:
I was not able to pinpoint the exact reason why this works. Could be the usage of sqlncli.dll instead of oledb.dll.
嗯,显然我问的问题是 XE2 中的一个错误,据说已通过更新 1 修复 http://docwiki.embarcadero.com/RADStudio/en/Release_Notes_for_XE2#Please_Install_XE2_Update_1
我会尝试看看它是否真的解决了问题。
Hrmm, apparently the question I asked was a bug in XE2 and supposedly fixed with Update 1 http://docwiki.embarcadero.com/RADStudio/en/Release_Notes_for_XE2#Please_Install_XE2_Update_1
I'll try and see if it really fixed the issue.
唯一适用于 XE2 的版本是 5.1.54 我遇到了同样的问题并通过此解决
The only version works with XE2 was 5.1.54 i had the same problem and being solved by this