unixODBC 错误“/usr/lib/libtdsodbc.so.0:错误的 ELF 类:ELFCLASS32”
我正在开发一个网站,需要通过 PHP 将数据从远程 MS SQL Server 数据库导入到 Unix 服务器上的 MySQL 数据库中。感谢 的回答这篇文章,我能够在我的开发环境(Mac OS X 10.6)上启动并运行所有内容。不过,现在我正在尝试设置我的服务器环境,即 CentOS 5.4。我安装并配置了 unixODBC 和 FreeTDS,但是当我尝试连接时,出现以下错误:
连接失败:[unixODBC][驱动程序管理器]无法打开 lib '/usr/lib/libtdsodbc.so.0' : /usr/lib/libtdsodbc.so.0: 错误的 ELF 类:ELFCLASS32 libtdsodbc.so.0.0
从我在互联网上找到的内容来看,我似乎安装了 32 位 unixODBC(或 FreeTDS,我不确定)(libtdsodbc.so.0 符号链接到 .0) 并且它需要是 64 位。这是正确的吗?如果是这样,如何升级到 64 位版本?我是一名开发人员,而不是服务器专家,所以这有点超出了我的服务器知识范围。
谢谢。
I am working on a site where I need to import data from a remote MS SQL Server database into a MySQL database on a Unix server via PHP. Thanks to answers to this post, I was able to get everything up and running on my dev environment (Mac OS X 10.6). Now, however, I'm trying to get my server environment set up, which is CentOS 5.4. I have unixODBC and FreeTDS installed and configured, but when I try to connect, I get the following error:
Connection Failed:[unixODBC][Driver Manager]Can't open lib '/usr/lib/libtdsodbc.so.0' : /usr/lib/libtdsodbc.so.0: wrong ELF class: ELFCLASS32
From what I've been able to find on the internets, it seems that I have 32 bit unixODBC (or FreeTDS, I'm not sure) installed (libtdsodbc.so.0 is symlinked to libtdsodbc.so.0.0.0) and it needs to be 64 bit. Is that correct? If so, how do I upgrade to 64 bit version? I'm a developer, not a server guru, so this is a bit outside of my server knowledge.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将 odbcinst.ini 中的引用从
/usr/lib/libtdsodbc.so.0
更改为/usr/lib64/libtdsodbc.so.0
为我们修复了此错误与您描述的配置相同。Changing the reference in odbcinst.ini from
/usr/lib/libtdsodbc.so.0
to/usr/lib64/libtdsodbc.so.0
fixed this error for us in the same configuration as you describe.你的诊断是正确的。但是无需升级,因为两者可以并行安装。
Your diagnosis is correct. There is no need to upgrade however, since the two can be installed in parallel.
这个修复对我不起作用。我也安装了
freetds.x86_64
(它让我安装,但报告了冲突),并且路径./usr/lib/libtdsodbc.so.0
是正确的。无论如何创建了一个符号链接,以防内部人员寻找它。我最初遵循了 MediaTemple 上的说明,但看过其他文章64 位 Cent 操作系统。如果我发现任何对我有用的东西,我会报告。
事实上,删除 FreeTDS、重新启动 Apache、安装上面提到的 64 位软件包并更新 odbcinst.ini 路径,我能够克服上述错误,并且实际上消除了错误。
我现在成功地与 MS SQL 服务器“对话”,尽管它现在给出了一般错误。 叹息。无论如何,大部分时间都到了那里。希望这对某人有帮助。
This fix didn't work for me. I did install
freetds.x86_64
as well (it let me install but reported conflicts) and the path./usr/lib/libtdsodbc.so.0
was correct. Created a symbolic link anyway in case internals would be looking for it.I originally followed the instructions at MediaTemple, but have seen other articles for Cent OS on 64-bit. Will report back if I find anything that works for me.
Indeed, removing FreeTDS, restarting Apache, installing the 64-bit package mentioned above and updating the odbcinst.ini path, I was able to get past the above error, and in fact, remove errors.
I am now successfully "talking" to the MS SQL server, although it is now giving me generic errors. sigh. Anyway, got most of the way there. Hope this helps someone.