免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 7363 | 回复: 16
打印 上一主题 下一主题

DBD-Sybase 安装出错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-20 17:01 |只看该作者 |倒序浏览
5可用积分
此贴已改
#!/usr/bin/perl

use DBI;

$dsn = 'DBI:Sybase:server=sql1';

my $dbh = DBI->connect($dsn, "test", 'test');
die "unable to connect to server $DBI::errstr" unless $dbh;

$dbh->do("use sqltest";

$query = "SELECT * FROM testtable";
$sth = $dbh->prepare ($query) or die "prepare failed\n";
$sth->execute( ) or die "unable to execute query $query   error $DBI::errstr";

$rows = $sth->rows ;
print "$row rows returned by query\n";

while ( @first = $sth->fetchrow_array ) {
   foreach $field (@first) {
      print "field: $field\n";
   }
}

[root@nagios ~]# ./a
Segmentation fault
[root@nagios ~]#



————————————————————————————————————————————


/etc/freetds.conf文件内容为:
[sql1]
        host = fabu
        port = 1433
        tds version = 4.2

——————————————————————————
[root@nagios ~]# ping fabu
PING fabu (192.168.3.235) 56(84) bytes of data.
64 bytes from fabu (192.168.3.235): icmp_seq=0 ttl=128 time=1.81 ms

--- fabu ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.810/1.810/1.810/0.000 ms, pipe 2
[root@nagios ~]#

为什么这个程序不行呢 我按照文档说的 是运行tsql没有问题啊

[root@nagios ~]# tsql -S fabu -U test
locale is "en_US.UTF-8"
locale charset is "UTF-8"
Password:
1>
2>


多谢各位老大了 我想之前的程序有问题应该也是一样吧?
抑或我的DBD::SYBASE

[ 本帖最后由 ppiqq 于 2009-6-1 16:39 编辑 ]

最佳答案

查看完整内容

你用嘛发行版?搜索过么?BTW,我倒是搜索了一下http://www.google.com/search?hl=en&q=rpm+dbd+sybase&aq=f&oq=&aqi=

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
2 [报告]
发表于 2009-05-20 17:01 |只看该作者
原帖由 ppiqq 于 2009-6-1 16:18 发表


报告大大 这个真的没有

你用嘛发行版?搜索过么?

BTW,我倒是搜索了一下
http://www.google.com/search?hl= ... =f&oq=&aqi=

论坛徽章:
0
3 [报告]
发表于 2009-05-20 17:02 |只看该作者
小弟看到了
If the automatic configuration fails, then you will have to edit the
CONFIG file, and set the EXTRA_LIBS entry according to your OS and
Sybase release, and then run
        perl Makefile.PL --file

The CONFIG file can be used to set certain system variables that
are needed for the build.
        SYBASE is the root directory of your Sybase installation. DBD::Sybase
        will use $SYBASE/lib and $SYBASE/include during the build.

        EXTRA_LIBS lists any extra libraries that are required on your
        system. For example, Solaris 2.x needs -ltli. See your OS specific
        documentation supplement from Sybase to determine what is required.

        DBI_INCLUDE is the directory where DBI installed its include files.
        Makefile.PL will normally deduce this directory from perl's Config
        module, so you only need to set this if Makefile.PL fails.

        LINKTYPE. Uncomment and set to 'static' if you want to build
        DBD::Sybase statically (ie always included in a new perl binary).

论坛徽章:
0
4 [报告]
发表于 2009-05-20 17:16 |只看该作者
大大们 我修改了CONFIG文件还是不行

修改如下:
SYBASE=$ENV{SYBASE}||'/opt/sybase'
EXTRA_LIBS=-linsck
DBI_INCLUDE=/usr/lib/perl5/5.8.8

但是仍然报错 求大大们指点一下

论坛徽章:
0
5 [报告]
发表于 2009-05-25 10:44 |只看该作者
UP UP~~~~~~~~~~~

论坛徽章:
0
6 [报告]
发表于 2009-05-25 11:08 |只看该作者
加到makefile里面看看。

论坛徽章:
0
7 [报告]
发表于 2009-05-25 11:37 |只看该作者
问题已经解决 原因是没有安装sybase的缘故
不好意思啊 大家 不过貌似还有个问题 我会在另一帖里面说明

论坛徽章:
0
8 [报告]
发表于 2009-05-25 12:10 |只看该作者
恭喜解决

论坛徽章:
0
9 [报告]
发表于 2009-05-25 13:14 |只看该作者

回复 #6 ppiqq 的帖子

ORZ!

论坛徽章:
0
10 [报告]
发表于 2009-05-27 06:22 |只看该作者
install freetds

export SYBASE="/usr/local"

就OK了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP