MySQl-connector: "ошибка query_cache_size"
Я новичок в API. Cоздаю приложение API для удаленного подключения к MySQL 8.0. Но при попытке запуска возникают ошибки. Я описал эти ошибки ниже. На форумах пишут, что ошибка может быть связана с сервером или URL-адресом, но при подключении к workbench все работает корректно
user.java
@Entity
@Table(name="users")
public class User {
@Id
private int id ;
private String login;
private String password;
public User() {
}
public User(int id, String login, String password) {
this.id = id;
this.login = login;
this.password = password;
}
//Getters and setters
}
userController.java
@RestController
@RequestMapping("/user")
public class UserController {
UserService userService;
public UserController(UserService userService) {
this.userService = userService;
}
@GetMapping("{vendorId}")
public User getUserDetails(@PathVariable("vendorId") int vendorId) {
return userService.getUser(vendorId);
}
@PostMapping
public String createUserDetails(@RequestBody User user) {
userService.creteUser(user);
return "User created successfully";
}
}
userRepository
public interface UserRepository extends JpaRepository<User, Integer> {
}
UserService
@Service
public class UserServiceImpl implements UserService {
UserRepository userRepository;
public UserServiceImpl(UserRepository userRepository) {
this.userRepository = userRepository;
}
@Override
public String creteUser(User user) {
userRepository.save(user);
return "Success";
}
@Override
public String updateUser(User user) {
userRepository.save(user);
return "Success";
}
@Override
public String deleteUser(int id) {
userRepository.deleteById(id);
return "Success";
}
@Override
public User getUser(int id) {
return userRepository.findById(id).get();
}
@Override
public List<User> getAllUsers() {
return userRepository.findAll();
}
}
application.yaml
spring:
datasource:
url: jdbc:mysql://mysql.hosting.nic.ru:3306/h406497953_db?useSSL=false
username: h406497953_mysql
password: *******
jpa.hibernate.ddl-auto: update
исключения
ERROR 10728 --- [API_try2] [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
java.sql.SQLException: Unknown system variable 'query_cache_size'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:130) ~[mysql-connector-j-8.3.0.jar:8.3.0]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-j-8.3.0.jar:8.3.0]
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:815) ~[mysql-connector-j-8.3.0.jar:8.3.0]
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:438) ~[mysql-connector-j-8.3.0.jar:8.3.0]
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241) ~[mysql-connector-j-8.3.0.jar:8.3.0]
...more