Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

[Bug] Problema ao configura MySQL

Olá,

Não estou conseguindo configurar o MySql, pois apresenta um erro:

Insira aqui a descrição dessa imagem para ajudar na acessibilidade

Erro: "C:\Program Files\Java\jdk-17\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2023.2\lib\idea_rt.jar=51008:C:\Program Files\JetBrains\IntelliJ IDEA 2023.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\souto\Downloads\Projeto final - Hibernate\2121-jpa-hibernate-persistencia-aula \target\classes;C:\Users\souto.m2\repository\org\hibernate\hibernate-entitymanager\5.4.27.Final\hibernate-entitymanager-5.4.27.Final.jar;C:\Users\souto.m2\repository\org\jboss\logging\jboss-logging\3.4.1.Final\jboss-logging-3.4.1.Final.jar;C:\Users\souto.m2\repository\org\hibernate\hibernate-core\5.4.27.Final\hibernate-core-5.4.27.Final.jar;C:\Users\souto.m2\repository\org\javassist\javassist\3.27.0-GA\javassist-3.27.0-GA.jar;C:\Users\souto.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;C:\Users\souto.m2\repository\org\jboss\jandex\2.1.3.Final\jandex-2.1.3.Final.jar;C:\Users\souto.m2\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;C:\Users\souto.m2\repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;C:\Users\souto.m2\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;C:\Users\souto.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.1\jaxb-runtime-2.3.1.jar;C:\Users\souto.m2\repository\org\glassfish\jaxb\txw2\2.3.1\txw2-2.3.1.jar;C:\Users\souto.m2\repository\com\sun\istack\istack-commons-runtime\3.0.7\istack-commons-runtime-3.0.7.jar;C:\Users\souto.m2\repository\org\jvnet\staxex\stax-ex\1.8\stax-ex-1.8.jar;C:\Users\souto.m2\repository\com\sun\xml\fastinfoset\FastInfoset\1.2.15\FastInfoset-1.2.15.jar;C:\Users\souto.m2\repository\org\dom4j\dom4j\2.1.3\dom4j-2.1.3.jar;C:\Users\souto.m2\repository\org\hibernate\common\hibernate-commons-annotations\5.1.2.Final\hibernate-commons-annotations-5.1.2.Final.jar;C:\Users\souto.m2\repository\javax\persistence\javax.persistence-api\2.2\javax.persistence-api-2.2.jar;C:\Users\souto.m2\repository\net\bytebuddy\byte-buddy\1.10.17\byte-buddy-1.10.17.jar;C:\Users\souto.m2\repository\org\jboss\spec\javax\transaction\jboss-transaction-api_1.2_spec\1.1.1.Final\jboss-transaction-api_1.2_spec-1.1.1.Final.jar;C:\Users\souto.m2\repository\com\h2database\h2\1.4.200\h2-1.4.200.jar" br.com.alura.loja.testes.CadastroDeProduto out. 23, 2023 2:01:47 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation INFO: HHH000204: Processing PersistenceUnitInfo [name: loja] out. 23, 2023 2:01:47 PM org.hibernate.Version logVersion INFO: HHH000412: Hibernate ORM core version 5.4.27.Final out. 23, 2023 2:01:48 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager INFO: HCANN000001: Hibernate Commons Annotations {5.1.2.Final} out. 23, 2023 2:01:48 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)

2 respostas
solução!

Oi Graziele,

O dialeto que você configurou é do banco de dados H2, mas as demais configuração são do MySQL. Defina o dialeto do Hibernate para MySQL.

            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

Olá, Mateus!

Corrigi a configuração e funcionou. Obrigada.