Configure MySQL db for a Spring-MVC project

两盒软妹~` 提交于 2019-12-23 02:46:14

问题


My current Database properties are as follows:

I want my Database to be MySQL. Can someone please guide me how to change the properties so it gets saved in MySQL.

I have installed MySQL on my Mac OSX. The Username is Root12 and password is xxx


回答1:


Well, you just need to replace all the properties appropriately:

  • the driverClassName is usually com.mysql.jdbc.Driver
  • the url should be like jdbc:mysql://host:3306/databaseName
  • the username and password you already have
  • dialect depends on ORM you are using, for ex for hibernate here is the list

This is the basic configuration




回答2:


this should work:

datasource.driverClassName=com.mysql.jdbc.Driver
dataSource.url=jdbc:mysql://localhost/test

hibernate.dialect=org.hibernate.dialect.MySQL5Dialect


来源:https://stackoverflow.com/questions/27857275/configure-mysql-db-for-a-spring-mvc-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!