Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何修复IJ中MySql服务器错误的连接Url_Java_Mysql_Hibernate_Jpa - Fatal编程技术网

Java 如何修复IJ中MySql服务器错误的连接Url

Java 如何修复IJ中MySql服务器错误的连接Url,java,mysql,hibernate,jpa,Java,Mysql,Hibernate,Jpa,我在项目中有Web、MySQL、Hibernet和JPA。 配置如下: <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc

我在项目中有Web、MySQL、Hibernet和JPA。 配置如下:

<hibernate-configuration>   <session-factory>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/springboot_hibernat</property>
    <property name="hibernate.connection.username">root</property>
    <property 
    name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
    <property name="Hbm2ddl.auto">update</property>
    <property name="show_sql">true</property>   </session-factory> </hibernate-configuration>[enter image description here][1]

com.mysql.jdbc.Driver
jdbc:mysql://localhost:3306/springboot_hibernat
根
org.hibernate.dialogue.mysql5dialogue
使现代化
true[在此处输入图像描述][1]

我认为项目的类路径中缺少MySQL/JDBC jar。请从项目中添加jar。

从这里下载:

注意:请注意MySQL/JDBC版本

对于版本>8.x,驱动程序类将是
com.mysql.cj.jdbc.driver

正确的hbm.xml文件如下所示:

<hibernate-configuration>
<session-factory>

<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/springboot_hibernate</property>
<property name="connection.user">root</property>
<property name="connection.password">password</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hbm2ddl.auto">update</property>

</session-factory>
</hibernate-configuration>

com.mysql.jdbc.Driver
jdbc:mysql://localhost:3306/springboot_hibernate
根
暗语
符合事实的
org.hibernate.dialogue.mysqldialogue
使现代化