Perl DBD::Informix connect string
Posted in 2000
Topics: Connectivity: ODBC / JDBC / .NET, Server Administration, Networking & sqlhosts Configuration, Versions, Editions & End-of-Life
Hi,
I've been having troubles trying to remotely connect to IDS 7.3 on a
Linux box (2.2.14.
Locally, everything works just fine:
$dbh = DBI -> connect ('dbi:Informix:bg@on_gandalf', 'user', 'pwd')
But when specifically mentioning the hostname (still on the same
system):
$dbh = DBI -> connect ('dbi:Informix://gandalf/bg@on_gandalf', 'user',
'pwd')
Does anyone see a problem with this connect string?
I've once been able to get odbc and jdbc remote connections to work, but
can't figure it out now...
Anton.
P.S. Some straightforward config-lines:
$INFORMIXDIR/etc/sqlhosts:
gandalf onsoctcp gandalf on_gandalf
$INFORMIXDIR/etc/gandalf.cfg:
NETTYPE soctcp,,,CPU
/etc/services:
on_gandalf 1536/tcp
/etc/hosts:
192.168.7.1 gandalf
/etc/profile:
export INFORMIXDIR=/usr/informix
export PATH=$INFORMIXDIR/bin:$PATH
export ONCONFIG=gandalf.cfg
root <toon.van.herreweghen@tvd.be> wrote:
> I've been having troubles trying to remotely connect to IDS 7.3 on a
> Linux box (2.2.14.
>
> Locally, everything works just fine:
> $dbh = DBI -> connect ('dbi:Informix:bg@on_gandalf', 'user', 'pwd')
>
> But when specifically mentioning the hostname (still on the same
> system):
> $dbh = DBI -> connect ('dbi:Informix://gandalf/bg@on_gandalf', 'user',
> 'pwd')
>
> Does anyone see a problem with this connect string?
It isn't a supported connect syntax!
You can either specify //host/dbase or dbase@server but not both at
once. Have you tried to connect using DB-Access with the notation you
specify? Did it work? If it doesn't work in DB-Access, it won't work
in DBD::Informix. All that DBD::Informix does is put the material after
'dbi:Informix:' into a string and pass it to the CONNECT statement.
When I try the syntax on my machine using SQLCMD, I get the error:
SQL[1219]: connect to '//anubis/stores@anubis_53';
SQL -554: Syntax disallowed in this database server.
SQL[1220]:
How are you checking your connection?
$dbh =
DBI->connect('dbi:Informix://gandalf/bg@on_gandalf','user','pass',{RaiseError=>1});
Or add an 'or die $DBI::errstr' after your version. But error check
your connection attempt under all circumstances. DBI only terminates
Perl if it fails to load the DBD::Informix driver, not if the driver
fails to connect to the specified database.
> I've once been able to get odbc and jdbc remote connections to work, but
> can't figure it out now...
>
> Anton.
>
> P.S. Some straightforward config-lines:
>
> $INFORMIXDIR/etc/sqlhosts:
> gandalf onsoctcp gandalf on_gandalf>
> $INFORMIXDIR/etc/gandalf.cfg:
> NETTYPE soctcp,,,CPU>
> /etc/services:
> on_gandalf 1536/tcp
>
> /etc/hosts:
> 192.168.7.1 gandalf
>
> /etc/profile:
> export INFORMIXDIR=/usr/informix
> export PATH=$INFORMIXDIR/bin:$PATH
> export ONCONFIG=gandalf.cfg
Thanks for this info -- it helps. I'd probably specify numbers in the
NETTYPEfield between the commas, but if the server boots and you can connect to
it, it isn't the cause of your specific trouble.
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"