一尘不染

用户'root'@'localhost'的访问被拒绝(使用密码:是)(Mysql :: Error)

mysql

我试图在服务器上部署Web应用程序,但出现此mysql数据库异常

Access denied for user 'root'@'localhost' (using password: YES) (Mysql::Error)

我试图使用mysql -u root -p所有的数据库操作从命令提示符处访问数据库。

有什么错误

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
    at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3649)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1176)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:2558)
    at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
    at java.sql.DriverManager.getConnection(DriverManager.java:620)
    at java.sql.DriverManager.getConnection(DriverManager.java:200)
    at com.mpigeon.DbConnection.DbConn(DbConnection.java:26)
    at com.mpigeon.CheckLoginHome.doGet(CheckLoginHome.java:39)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

阅读 684

收藏
2020-05-17

共1个答案

一尘不染

您需要授予从本地主机对root的访问权限。查看
ubuntu帮助

2020-05-17