Start springboot and mysql. What if springboot cannot connect to MySQL service?

Alibaba cloud Q & A 2022-02-13 06:46:07 阅读数:830

start springboot mysql. mysql springboot

image.png image.png

datasource: url: jdbc:mysql://localhost:3306/blog username: root password: songbuqi

What's wrong with the cows ?

Take the answer 1:

Hello! , This should not be localhost, It is container name.(blog-db)

url: jdbc:mysql://localhost:3306/blog

copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you.