|
Home > Archive > SQL Anywhere for Linux > April 2005 > DBI::ASAny remote connection
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
DBI::ASAny remote connection
|
|
|
| Hi, I'm just trying to establish a connection between ASA
and a remote linux client on another machine.
This is my code:
my $DB = DBI->connect("DBI:ASAny:192.168.0.249",
" UID=dba,PWD=sql,ENG=
asademo")or die $@;
$sth = $DB->prepare("blablabla......
This code works well on local machine, but when I launch the
same from the remote client I have the following error:
DBI
connect('192.168.0. 249','UID=dba;PWD=sq
l;ENG=asademo',...)
failed: Database server not found (DBD: login failed) at
./sybtst.pl line 8
Died at ./sybtst.pl line 8.
I have installed both libraries on remote machine (and it
works fine as local server)
Is there a particular syntax to invoke the connection method
?
or what ?
Thanks
Jean Marie
| |
| Joshua Savill 2005-04-05, 8:03 pm |
| Jean,
How are you starting the database server? You are using dbsrv9 and not
dbeng9? If so, try specifying doboardcast=yes under the tcpip switch.
Are you able to ping the physical server from the client machine?
Please always provide the version and build of ASA.
--
Joshua Savill
iAnywhere Solutions - Product Support Analyst
<jean> wrote in message news:41c8582e.4a3d.1681692777@sybase.com...
> Hi, I'm just trying to establish a connection between ASA
> and a remote linux client on another machine.
> This is my code:
>
> my $DB = DBI->connect("DBI:ASAny:192.168.0.249",
> " UID=dba,PWD=sql,ENG=
asademo")or die $@;
> $sth = $DB->prepare("blablabla......
>
> This code works well on local machine, but when I launch the
> same from the remote client I have the following error:
>
> DBI
> connect('192.168.0. 249','UID=dba;PWD=sq
l;ENG=asademo',...)
> failed: Database server not found (DBD: login failed) at
> /sybtst.pl line 8
> Died at ./sybtst.pl line 8.
>
> I have installed both libraries on remote machine (and it
> works fine as local server)
> Is there a particular syntax to invoke the connection method
> ?
> or what ?
>
> Thanks
> Jean Marie
| |
| Greg Fenton 2005-04-05, 8:03 pm |
| Along with Joshua's response, you might consider adding
";LOG=/tmp/asa_client.log" to your connection parameters. This will
cause the client library to log its attempt to contact the server into
the file /tmp/asa_client.log (BTW: you can use any valid path you wish).
Then you can see where the connection is failing.
Note that DoBroadcast is enabled by default so that suggestion shouldn't
be necessary (though it won't hurt).
Can you show us the startup command for your ASA engine?
Is the ASA engine on the same sub-net as the remote client?
Note: though ASA's client libraries ability to automatically detect a
server on the network is a nice feature, it can also be the cause of
problems depending on your configuration. I typically in a production
environment code the parameters for my database server in the LINKS
parameter rather than having the client "detect" the server:
UID=DBA;PWD=SQL;LINK
S=tcpip(host=my_asa_
host.mycorp.com;port=2369);...
One problem I see commonly enough is customers who attempt to run
multiple databases with the same engine name on the same LAN. They
either have troubles running the second server (it won't startup if
DoBroadcast is enabled) or their client apps inadvertently connect to
the wrong engine.
You'll need to weigh the pros and cons of each approach and compare
those with the requirements for your application and your production
environment.
Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
| |
|
| I think this line should be right :
my $dbh =
DBI->connect(" DBI:ASAny:ENG=asadem
o"," UID=dba;PWD=sql;LINK
S=tcpip(host=192.168.0.249;
port=2369);LOG=/home/jean/src/asa_log") or die $@;
And It really works!
You gave me the key!
Thanks!
Jean
|
|
|
|
|