The account name of win10 appears when springBoot connects to the database

1. Problem description

This problem is generally caused by carelessness, and it is the first time this problem has occurred, so record that
when connecting to the database, Access denied for user '10272'@'localhost' (using password: YES), but '10272' is My win10 account, and the yml file is
the configuration in the root yml file used

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.zaxxer.hikari.HikariDataSource
    url: jdbc:mysql://localhost:3306/sbvue?useUnicode=true&characterEncoding=utf-8&useSSL=true
    name: root
    password: 

problems
insert image description here

2. The cause of the problem

The datasource:name is configured in the yml file, and the win10 account is read

3. Problem solving

Change the name to username in the yml file

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.zaxxer.hikari.HikariDataSource
    url: jdbc:mysql://localhost:3306/sbvue?useUnicode=true&characterEncoding=utf-8&useSSL=true
    username: root
    password: 

Guess you like

Origin blog.csdn.net/The_girl_wait_me/article/details/124704954