When I use Hibernate to connect to a MySQL database, bookstoredb, in Eclipse, a connection to the MySQL sys database also shows up!
I'm using the following:
- Ubuntu 18.04.5 LTS (desktop)
- Eclipse 2020-6 (4.16.0) w/JBoss Tools, Hibernate-Tools plugin.
- MySQL Ver 8.0.21 for Linux on x86_64 (MySQL Community Server - GPL)
Note: this is a local desktop project, I am working through a tutorial. I will NOT be using root/admin with MySQL down the road.
Following is the complete hibernate.cfg.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">admin</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/bookstoredb?serverTimezone=UTC</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
</session-factory>
</hibernate-configuration>
Am I misunderstanding, shouldn't the connection.url, as given, ONLY connect to bookstoredb? Why is "sys" connecting also?
This becomes even more of a problem when using the tool to reverse-engineer the database tables into java classes. I'm getting not only the bookstoredb tables as java classes but every table in the sys database as well. And there are a lot of them, as I am sure folks well know.
How do I unlink the sys database? Or set things up so I don't link to it in the first place?