Alice52 / project

This repository is muti language and tech integration project.
MIT License
0 stars 0 forks source link

[ec] local docker deploy about mysql #107

Closed Alice52 closed 3 years ago

Alice52 commented 3 years ago

deploy docker container in local failed

root cause

  1. guess: ec-product cannot find host mysql service, it just find mysql in it's own system, so error occurs.
Alice52 commented 3 years ago

solution

  1. Please change mysql uri to jdbc:mysql://dev-mysql:3306/ec_pms?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
  2. Then make sure mysql [container name is dev-mysql] and ec-product in same network
  3. It can also use -Dspring.datasource.druid.url to specify URI if the mysql container's name is mutable

reference

  1. https://segmentfault.com/q/1010000018761454