Hi!
Cause analysis
The possible cause is that an incorrect binary file is used for the database connection. Try to connect to the database and check the connection result.
The command output indicates that the connection failed even if the gaussdb process is running properly. So, the failure may be caused by the incorrect configuration of source for the profile or .bashrc file. Check the configuration file.

In the configuration file, the correct source path (highlighted) for the profile is commented out and the MPPDB path (white) is in use.
Solution
Correct the source configuration in the configuration file as follows:
source /home/omm/.mpp_profile
# source /opt/huawei/Bigdata/mppdb/.mppdbgs_profile