So I created a database on my cloud server with the following commands:
mysql> create database app1;
Query OK, 1 row affected (0.02 sec)
mysql> grant all privileges on app1.* TO 'app1'@'localhost'
identified by 'abcdefg';
Query OK, 0 rows affected (0.02 sec)
then I updated my persistance.xml as follows:
<persistence-unit name="app1">
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/app1" />
<property name="javax.persistence.jdbc.user" value="app1" />
<property name="javax.persistence.jdbc.password" value="abcdefg" />
<property name="javax.persistence.schema-generation.database.action"
value="create" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
but I still get the this error when I try to visit the site from a browser:
java.sql.SQLException: Access denied for user 'app1'@'127.0.0.1' (using password: YES)
I verified that the user exists with:
SELECT User FROM mysql.user;
what can be causing this issue??