Configure MySQL db for a Spring-MVC project

2019-06-02 07:13发布

My current Database properties are as follows:

enter image description here

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

2条回答
贼婆χ
2楼-- · 2019-06-02 08:11

this should work:

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

hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
查看更多
对你真心纯属浪费
3楼-- · 2019-06-02 08:13

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

查看更多
登录 后发表回答