Hello everyone. I'm trying to do reverse engineering on my Maven project using Hibernate. But it keeps giving me this error message:
Reading schema error: Error while reading column meta data for mysql.user
Pom:
<dependencies>
<!-- https://mvnrepository.com/artifact/com.mysql/mysql-connector-j -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.0.33</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate.orm/hibernate-core -->
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>6.2.3.Final</version>
</dependency>
</dependencies>
</project>
Hibernate.cfg.xml:
<hibernate-configuration>
<session-factory name="Conection">
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/busstation</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
</session-factory>
</hibernate-configuration>
Console configuration: Bus Station CC
MYSQL Database Script:
DROP DATABASE IF EXISTS BusStation;
CREATE DATABASE IF NOT EXISTS BusStation;
USE BusStation;
CREATE TABLE IF NOT EXISTS Bus(
n INT PRIMARY KEY AUTO_INCREMENT,
sits INT NOT NULL,
plate CHAR(5) NULL
);
INSERT INTO Bus (sits, plate) VALUES(24, 'AAAAA');
INSERT INTO Bus (sits, plate) VALUES(28, 'AAAAB');
INSERT INTO Bus (sits, plate) VALUES(12, 'AAAAC');
INSERT INTO Bus (sits, plate) VALUES(48, 'AAAAD');
Thank you for your time.
The Hibernate.cfg.xml lacked some necessary properties. It's fixed now.