出现的问题
null, message from server: "Host ' ' is not allowed to connect to this MySQL server"
解决方式
第一步:链接数据库(输入密码)
mysql -uroot -p
第二步:选择好数据库
use mysql;
第三步:修改数据库权限范围
update user set host='%' where user='root';
第四步:刷新权限到数据库
flush privileges;
application.yml文件写法
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/demand?useUnicode=true&characterEncoding=UTF-8&serverTimeZone=UTC
url: jdbc:mysql://123.456.789.100:3306/demand?useUnicode=true&characterEncoding=UTF-8&serverTimeZone=UTC
username: root
password: root