我已经在tomcat服务器上部署了我的应用程序。
在我的应用程序中,我编写了用于休息web服务api实现的代码,我正在尝试建立与mySQL数据库的连接。
代码如下:
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.
getConnection("jdbc:mysql://localhost:3306/pharmacy", "pharm", "@Pharm123");
我正在使用mySQL连接器版本8.0.11。
当我调试时,我知道它正在抛出异常,如下面的
com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException Client does
not support authentication protocol requested by server; consider upgrading
MySQL client
我也在mySQL数据库中尝试了以下步骤
use pharmacy;
CREATE USER 'pharm'@'localhost' IDENTIFIED BY '@Pharm123';
GRANT ALL ON pharmacy.* TO 'pharm'@'localhost';
你可以指导我如何继续前进吗?