Connecting to Sybase using sqsh

3.2k Views Asked by At

I am new to sybase. I am trying to connect to the database using sqsh.

sqsh -Ddatabasename -Hservername -Uusername
or
sqsh -D databasename -H servername -U username

I get the following error. server name not found in configuration file. unknown host machine name. I am trying to connect using the command line. Wouldn't that bypass a config file.

2

There are 2 best solutions below

0
knb On BEST ANSWER

I'm on Linux and I use sqsh like this:

sqsh -I /etc/freetds/freetds.conf -Smyserver  -Uknb -Pverysecret -Dmydb

-D argument is optional

and in the /etc/freetds/freetds.conf there is an entry

[myserver]
        host = 123.456.78.90
        port = 1433
        tds version = 7.2
        client charset = UTF-8

This used to work for many years. Right now I have some connectivity problems (segfaults), but this can be due to library configuration issues on my PC.

0
RobV On

Don’t use the hostname. Use -S for the servername , which must be defined in the interfaces file (or sql.ini file). You can leave the database name out.