Cannot Connect to a Database

You may experience problems connecting to a database.

Possible Causes

  • Data source is not defined, or you have entered or defined it incorrectly.

    A data source is a set of connection parameters, stored in the registry (on Windows) or in a file (Windows and UNIX).

  • An incorrect user name or password is specified. The error messages returned are:
    Unable to connect
    or,
    Could not connect to the database.
    followed by the message:
    Invalid user ID or password.
    Try connecting again with the correct user ID and password.
  • User may not have permission to use the database.

  • You are connecting over TDS (for example, using jConnect) and the user ID or password is longer than 30 bytes. You see:
    Invalid user ID or password
    CT-LIBRARY error:
    ct_connect(): protocol specific layer: 
    external error: The attempt to connect to the server failed.
  • You provide an incorrect database file name. The error messages returned are:
    Unable to connect
    or,
    Could not connect to the database.
    followed by the message:
    Specified database not found.
    Try connecting again with the correct database file name.

    You must supply the DBF parameter and the database file name to connect when you use Interactive SQL and you have restored the database from backup while connected to utility_db.

  • Database files may be missing. The files dbname.db, dbname.iq, and dbname.iqmsg (where dbname is the name of the database) must all exist.

  • A limit on the number of connections or other DBA-defined login restrictions may be exceeded. The error messages returned are:
    Unable to connect
    Database server connection limit exceeded.
  • You have run out of disk space. Check the Sybase IQ message file for messages related to disk space.

  • The server name specified is not correct. The error messages returned are:
    Connection failed.
    Database server not running.
    Check the name of the server and try connecting again with the correct server name.
  • The server machine name or address has changed.

  • When connecting from a client for the first time and the server name is not specified, providing the wrong port number can cause a failure to connect to the database. The error messages returned are:
    Could not connect to the database.
    Database server not found.
    When connecting from Interactive SQL, ensure that the name in the Server Name field is spelled correctly, that the network options on the network tab are correct, and that the database server has been started. Either provide the server name when connecting, or use the correct port number. To determine the server name and the number of the port on which the server is listening, run the command stop_iq (UNIX), which displays this information.
  • Port number may be out of correct range or in use by another process.

  • If you receive the message:
    Unable to start — server not found
    or
    Database server not running.
    when trying to start the client, the client cannot find the database server on the network. The connection string may be incorrect or the server name cache may contain incorrect or old connection information. For example, if the server is started with a different port number, even if the client application specifies the new port number at connect time, the connection information is still taken from the server name cache.
  • You specified a character set in the CharSet connection parameter and tried to connect to a server that does not support that character set. If the server does not support the requested character set, the connection fails.

    Try reconnecting without specifying CharSet. If the client's local character set is unsupported by the server, the connection succeeds, but with a warning that the character set is not supported.

Note:

Do not confuse an inability to connect to a database with a Sybase IQ server-level error while Sybase IQ is trying to open a database.

Action

If you suspect that you cannot connect because there is a problem with the database, you can look in the dbname.iqmsg file to determine where the problem occurred.

If the message Open Database Completed appears, then the database opened without error and the problem is related to the clients connecting. If the message does not appear, then the database may have failed while opening or recovering.

Related concepts
Required Command Line Options