我是DB2的新手,所以我在这里犯了一个基本的错误。
我尝试过使用Perl的DBD :: DB2模块:
my $dbh = DBI->connect("dbi:DB2:DATABASE=$dbname; HOSTNAME=$host; PORT=$port; CONNTYPE=2", $user, $pass) || die "DB2 connection failed: $DBI::errstr\n";
这导致:
[IBM][CLI Driver] SQL30020N Execution of the command or SQL statement failed because of a syntax error in the communication data stream that will affect the successful execution of subsequent commands and SQL statements: Reason Code "0x124C"("0209")"". SQLSTATE=58009
我还试过/etc/odbc.ini
:
[testdm]
Description = Test db2
Driver = /usr/local/dsdriver/lib/libdb2o.so
Trace = Yes
TraceFile = /var/tmp/rotate7/db2_odbc.log
Database = S102YGCM.CHICAGO.LOCAL
System = 10.0.0.2
UserName = xxxxxxxx
Password = xxxxxxxx
Port = 446
运行isql -v testdm
会产生类似的结果:
[08001][unixODBC][IBM][CLI Driver] SQL30020N Execution of the command or SQL statement failed because of a syntax error in the communication data stream that will affect the successful execution of subsequent commands and SQL statements: Reason Code "0x124C"("0209")"". SQLSTATE=58009
This page at IBM表示124C表示"请求的DRDA数据流包含语法错误。"但我不知道如何解决这个问题。
有什么建议吗?