Skip to content
Snippets Groups Projects
Commit 0c7db646 authored by Dave Syer's avatar Dave Syer
Browse files

Make mysql configuration more first class

parent 8b76a548
No related branches found
No related tags found
No related merge requests found
mysql:
image: mysql
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=test
volumes:
- "./conf.d:/etc/mysql/conf.d:ro"
\ No newline at end of file
......@@ -74,6 +74,11 @@
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!-- EhCache -->
<dependency>
......
# database init, supports mysql too
database=mysql
spring.datasource.url=jdbc:mysql://localhost/test
spring.datasource.username=root
spring.datasource.password=root
# Uncomment this the first time the app runs
# spring.datasource.initialize=true
\ No newline at end of file
......@@ -9,11 +9,9 @@
--------------------------------------------------------------------------------
1) Download and install the MySQL database (e.g., MySQL Community Server 5.1.x),
which can be found here: http://dev.mysql.com/downloads/
which can be found here: http://dev.mysql.com/downloads/. Or run the
"docker-compose.yml" from the root of the project (if you have docker installed
locally).
2) Add the MySQL JDBC driver to your classpath.
3) Set "database=mysql" in "application.properties"
4) Create the PetClinic database and user by executing the "db/mysql/{schema,data}.sql"
scripts (or set "spring.datasource.initialize=true" the first time you run the app.
2) Create the PetClinic database and user by executing the "db/mysql/{schema,data}.sql"
scripts (or set "spring.datasource.initialize=true" the first time you run the app).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment