Re: suppressing username and password prompts in dbaccess
Posted in 2007
On 19 дек, 16:47, skurlan...@yahoo.com wrote:
> Hi,
>
> Our site is running Informix Dynamic Server 11 on Linux. Currently,
> when connecting to a server using dbaccess the user is prompted for
> his user name and password. What options are available so providing a
> user name and password is unnecessary, as the username and password is
> the same one as they used to log into their machine.
It may be interesting for you information from Informix docs (dbacces
guide).
===========
You can use the CONNECT... USER syntax in SQL statements that you
issue in
interactive mode. However, DB-Access does not support the USER clause
of
the CONNECT statement when you connect to a default database server.
- Connecting in Interactive Non-Menu Mode
When you include the USER 'user identifier' clause in a CONNECT
statement in
interactive mode, DB-Access prompts you to enter a password. You can
either
enter a user identifier or press the RETURN key. If you enter a user
identifier,
follow the syntax guidelines described in IBM Informix Guide to SQL:
Syntax.
If you enter a password, it does not appear on the screen.
The following two command examples show how to connect to a database
server in interactive mode. The first example uses the CONNECT
statement
without specifying a user identifier.
dbaccess - -
> connect to '@starfish';
Connected.
If you include the USER clause in a CONNECT statement, as the second
example shows, DB-Access uses echo suppression to prompt you for a
password:
> connect to '@starfish' user 'marae';
ENTER PASSWORD:
Connected.
- Connecting with a File or Shell File in Background Mode
You can execute the USER clause of a CONNECT statement in a DB-Access
file
that includes the USER clause. The following example uses a command
file
that contains a CONNECT statement with a USING clause to connect to a
database server:
dbaccess - connfile.sql
Important: An SQL command file that contains the statement
CONNECT USER user_id USING password
should be protected from access by anyone other than the user_id that
the USER clause identifies.
The following example uses a shell file to connect to a database
server.
DB-Access prompts you for a password.
dbaccess - - <<\\!
connect to '@starfish' user 'marae';
!
ENTER PASSWORD:
================
Basil