I have a maven project that connects to a database that already exists. however i wanted to change it so that if the database doesn't already exist. it gets created. so i added in this extra code ?createDatabaseIfNotExist=true
to this line.
dataSource.url=jdbc:mysql://localhost/rays-database?createDatabaseIfNotExist=true
And i got a lot of errors, so my question is; is there any extra configuration that im missing in order to use ?createDatabaseIfNotExist=true
I also tried adding the port number which didn't make any difference which i didn't expect it to.
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://localhost/rays-database?createDatabaseIfNotExist=true
dataSource.username=root
dataSource.password=
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create