Fatal error: it is not used for host 192.168.1.112. After postgres solves the problem of installing postgresql9.2, QT connects to the database: Cpp Code www.2cto. comQSqlDatabasedbQSqlDatabase: addDatabase (QPSQL, test); db. setDatabaseName (sqlscada); db. setHostName (127.0.0.1); db. setHostName (1
Fatal error: it is not used for host 192.168.1.112. After postgres solves the problem of installing postgresql9.2, QT connects to the database: Cpp Code www.2cto.com QSqlDatabase db = QSqlDatabase: addDatabase (QPSQL, test); db. setDatabaseName (sqlscada); // db. setHostName (127.0.0.1); db. setHostName (1
Fatal error: not used for host "192.168.1.112", user "s" solved
After sql9.2 is installed, QT connects to the database:
Cpp Code www.2cto.com
QSqlDatabase db = QSqlDatabase: addDatabase ("QPSQL", "test ");
Db. setDatabaseName ("sqlscada ");
// Db. setHostName ("127.0.0.1 ");
Db. setHostName ("192.168.1.112 ");
Db. setPort (5432 );
Db. setUserName ("s ");
Db. setPassword ("scada ");
Connect to the Local Machine with 127.0.0.1 OK. If the IP address is specified for connection, an error is returned: Fatal error: not used for host "192.168.1.112", user "postgres ";
Open $ POSTSQL/data/pg_hdb.conf and find
# IPv4 local connections:
Host all 127.0.0.1/32 md5
Add a line of code below:
Host all 192.168.1.112/32 md5
Reconnect. Everything is normal.