目录
问题
在使用Springboot启动项目的时候,报错已解决:MySQL8报错:Public Key Retrieval is not allowed
解决方法
第一种
在命令行模式下进入mysql,输入以下命令:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
或者
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
第二种
在yml里面配置数据源的时候,url的属性属性allowPublicKeyRetrieval设置为true即可
希望以上方法能帮助到大家!