I am creating an API for an additional connection of an android application to MySQL. When I connect to the local database, everything works fine, and if I enter the URL, username and password of the remote MySQL server, various errors will appear (I managed to connect to the database from workbench – everything worked out).
For example, metadata is required, then you are asked to set a dialect. when I set the dialect in application.properties, a query_memory_size error or an error related to the ‘EntityManagerFactory’ appears
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution [Unknown system variable 'query_cache_size'] [n/a]
My final settings
spring.application.name=API_try6
spring.datasource.url=jdbc:mysql://mysql.hosting.nic.ru:3306/h406497953_db?useSSL=false
spring.datasource.username=****
spring.datasource.password=****
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
#spring.jpa.properties.hibernate.cache.use_query_cache=true
#spring.jpa.properties.hibernate.cache.use_query_cache=false
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
server.port=8080
spring.datasource.hikari.allow-pool-suspension=true
spring.jpa.properties.hibernate.boot.allow_jdbc_metadata_access=false
spring.sql.init.mode=never
user26859779 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1