Spring Boot while scanning for the next tokenfound character ‘@‘ that cannot start any token问题解决

问题描述:

Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation) in 'reader', line 91, column 19: password: @123

问题分析:

1、password参数值以@开头导致报错。

        url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: root
        password: @123

解决办法:

password参数值添加单引号。

        url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: root
        password: '@123'