Help Center> Data Warehouse Service (DWS)> Troubleshooting> Database Connections> What Do I Do If gsql: command not found Is Displayed When I Run gsql to Connect to the Database?
Updated on 2024-01-25 GMT+08:00

What Do I Do If gsql: command not found Is Displayed When I Run gsql to Connect to the Database?

Symptom

The following error information is displayed when running the gsql -d postgres -p 26000 -r command:

1
gsql: command not found...

Possible Causes

  • The command is not executed in the bin directory of gsql.
  • The environment variable is not executed.

Handling Procedure

  1. Run the environment variable in the client directory, for example, in the /opt directory.

    1
    2
    cd /opt
    source gsql_env.sh
    

  2. Go to the bin directory of gsql and run the gsql command to connect to the database.

    cd bin
    gsql -d gaussdb -h Database_IP_address -p 8000 -U dbadmin -W Database_user_password -r;