this issue can be rectified using below steps:-
step 1 :- run below query in mysql and restart it (for version >8.0 ,username is root here)
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
step 2:- check the version of your mysql by running select version(); in mysql
the version of mysql in pom.xml should be same as the version of mysql installed (mine is 8.0.14)
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.14</version>
step 3:-if the mysql-connector jar file is not there in maven repository you can download the 8.0.14 version jar and can paste it in repository
$\.m2\repository\mysql\mysql-connector-java\8.0.14
step 4:- update your maven project
step 5:- check for driverClassName in config.xml, it should be "com.mysql.cj.jdbc.Driver".