I have a maven project that connects to a database that already exists. however, I wanted to change it so that if the database does not exist yet. he is being created. so I added this additional code ?createDatabaseIfNotExist=true
to this line.
dataSource.url=jdbc:mysql://localhost/rays-database?createDatabaseIfNotExist=true
And I have a lot of errors, so my question is: is there any additional configuration that is missing for use? createDatabaseIfNotExist = true
I also tried adding a port number that did not matter, which I did not expect.
dataSource.url=jdbc:mysql://localhost:3306/rays-database?createDatabaseIfNotExist=true
here is my .properties file:
dataSource.driverClassName=com.mysql.jdbc.Driver
dataSource.url=jdbc:mysql:
dataSource.username=root
dataSource.password=
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create
source
share