2

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.

user3525290
  • 1,557
  • 2
  • 20
  • 47
  • which Sybase product (ASE? SQLAnywhere? IQ? Advantage?)? is `servername` the name of your Sybase server or the machine/host that Sybase is running on? (if the former, try replacing `-H` with `-S`) – markp-fuso Nov 16 '17 at 16:21

2 Answers2

3

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.

knb
  • 9,138
  • 4
  • 58
  • 85
0

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.

RobV
  • 2,263
  • 1
  • 11
  • 7