This error message means the password is not provided and is rejected by the MySQL database. However, it has been supplied with the java command definitely. The reason is that the auth plugin,
caching_sha2_password
is not compatible with the driver,
org.mariadb.jdbc.Driver. In MySQL 8.0,
caching_sha2_password
is the default authentication plugin rather than
mysql_native_password
.
This issue can be solved by switching back to auth plugin
mysql_native_password
.
alter user 'username'@'localhost' identified with mysql_native_password by 'password';