报错如下:

解决办法
在连接数据库的配置文件中加上&allowPublicKeyRetrieval=true语句,如下:
jdbc:mysql://localhost:3306?useUnicode=true&zeroDateTimeBehavior=convertToNull&autoReconnect=true&characterEncoding=utf-8&useSSL=false&useInformationSchema=true&allowPublicKeyRetrieval=true
添加后,能够正常访问数据库库表字段,如下图所示




![[PTA] 分解质因子](https://img-blog.csdnimg.cn/direct/703cbe5c7bd74448a861542e13fb0208.png)















