gpt4 book ai didi

mysql - [SQL异常 : Access denied for user '' @'179.43.156.163' (using password: YES)]

转载 作者:行者123 更新时间:2023-11-29 18:26:44 25 4
gpt4 key购买 nike

我知道 SO 上有很多关于这个论点的主题,但我认为我的不同,或者我只是找不到它。我使用 play 框架 2.6,我的 application.conf 如下所示:

default.db = {
url="jdbc:mysql://xxx.xxx.rds.amazonaws.com/dbname"
host="xxx.xxx.rds.amazonaws.com"
driver="com.mysql.jdbc.Driver"
username="root"
password="password"
}

编辑:其他可能重要的部分:

slick.dbs.default.driver = "slick.driver.MySQLDriver$"
play.http.secret.key="KVNU8u1lFSV_eNdfc=6oMnP@M<bH4YS<ZJqC5954p@S>=PiXwusl:vf>RWL2w_=D"
play.filters.hosts.allowed = ["."]

我不断得到这个:

java.sql.SQLException: Access denied for user ''@'19.345.16.16' (using password: YES)

经过多次尝试,我也得到了这个:

SQLTransientConnectionException: ec2 - Connection is not available, request timed out after 1000ms.]

为什么它尝试与空用户连接?我已经尝试过没有“”和许多其他组合..

编辑:我让它与空字段('')用户连接,因此允许类型为''@'%'的用户,但我仍然需要弄清楚为什么 slick 尝试与匿名用户连接。现在 application.conf 的合理部分是:

slick.dbs.default.profile = "slick.jdbc.MySQLProfile$"
slick.dbs.default.db = {
url="jdbc:mysql://xxx.xxx.us-west-2.rds.amazonaws.com/metamusic"
host="xxx.xxx.us-west-2.rds.amazonaws.com"
driver="com.mysql.jdbc.Driver"
username=aa_admin
password="password"
keepAliveConnection = true
connectionPool = disabled
}

最佳答案

对于原来的问题:

java.sql.SQLException:用户“@”19.345.16.16'的访问被拒绝(使用密码:YES)

我同意 nitin.sharma0180 的回答,这听起来像是 MySQL 用户权限错误和/或密码在转换到托管数据库的服务器时丢失。尝试检查您使用的用户是否对数据库和表具有显式权限,或者可能只是由于字符编码而导致密码错误。

如果前一个不起作用,那么这取决于您如何通过 Play 2.6 Framework 连接到数据库。您使用的是 JPA、直接 JDBC 还是其他?要回答这个问题,请检查您的 build.sbt、application.conf 以及导入到项目中的 Play 2 模块。

关于mysql - [SQL异常 : Access denied for user '' @'179.43.156.163' (using password: YES)],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46122965/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com