Tag Archives: PostgreSQL

[Solved] MYSQL Error: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana]

1. When calling an interface, an interface reports an error

o.s.b.f.xml. XmlBeanDefinitionReader: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]

o.s.jdbc. support. SQLErrorCodesFactory : SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana]

Screenshot information:

2. Solution ideas

(1) Look at the problem description, it is a database problem.

(2) Check the interface log, through the log, you can initially locate the problem in the “==> Preparing: REPLACE into” sql statement, while the log returned the sql statement’s input “==> Parameters”

(3) According to the parameters, the sql statement was executed in Navicat, and the result came out because of the problem of foreign keys in the database.

3.Summary

The problem how to solve is not the focus, the focus is to encounter such problems, first check the logs, locate where the problem, and then targeted to solve.

There are several common problems in the degree, such as field naming errors, type mismatch, data problems.

At the end of the day, according to the logs, execute the problem statement in the visual sql execution tool. The problem can be solved.

[Solved] When PostgreSQL writes data to Excel, there is a failure your, nginx error handling

Today’s development colleagues read the data from PostgreSQL and wrote it to excel. Due to the large amount of data, the development colleagues wrote the code that was not good enough and the speed was too slow, so there was a problem. I found the following information and modified the configuration of nginx to solve this problem. The detailed errors are as follows:

An error occurred.

Sorry, the page you are looking for is currently unavailable.

Please try again later.
If you are the system administrator of this resource then you should check theerror log for details.
Faithfully yours, nginx.

Solution:

Change localhost in nginx configuration file to IP

Or

Modify the hosts file and add 127.0.0.1 localhost

location/{  
    proxy_pass http://localhost:8080  # change to 127.0.0.1
}

Set connection time

proxy_ connect_ timeout 300; # The connection timeout between nginx and back-end server (proxy connection timeout)
proxy_ send_ timeout 300; # Back end server data return time (proxy sending timeout)
proxy_ read_ timeout 600; # After successful connection, the response time of back-end server (proxy receiving timeout)

is shorter

After modifying the configuration file, reload the configuration file

nginx -s reload

PostgreSQL Connect Error: FATAL: no pg_hba.conf entry for host

The server doesn’t grant access to the database: the server reports
FATAL: no pg_ hba.conf entry for host “192.168.0.123”, user “postgres”, database “postgres” FATAL: no pg_ hba.conf entry for host “192.168.0.123”, user “postgres”, database “postgres”

PostgreSQL database will not listen for all connection requests except local ones for security. When users access the database through JDBC, they will report some exceptions as follows:

org.postgresql.util.PSQLException: FATAL:nopg_ hba.confentryforhost

To solve this problem, you only need to find/data/PG in the installation directory of PostgreSQL database_ Hba.conf, find “# IPv4 local connections:”

Add the IP of the machine to which the connection is requested

hostall all 127.0.0.1/32 md5

32 is the segment of the subnet mask; MD5 is a password verification method, which can be changed to trust