Bootstrap FreeKB - Linux Commands - isql (connect to a database)
Linux Commands - isql (connect to a database)

Updated:   |  Linux Commands articles

The isql command can be used to connect to a database. The -b (batch) flag is used to run the command in non-interactive mode. In this example, a connection is made to db001 as john.doe.

isql -b db001 john.doe itsasecret

 

If connecting to a Microsoft SQL Server database, you will want to use the -k option to use the SQLDriverConnect following by the connection parameters.

isql -b -k "DRIVER={ODBC Driver 17 for SQL Server};Server=server001;Database=db001;UID=john.doe;PWD=itsasecret"

 

Often, you will want to issue a command against the database, like this.

show databases | isql -b db001 john.doe itsasecret

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 2d355c in the box below so that we can be sure you are a human.