[英]heroku node js cleardb mysql fail : ER_ACCESS_DENIED_ERROR: Access denied for user
Today I'm pushing my app on heroku, I create the database with cleardb, configure it by using a software (navicat premium) for create tables. 今天,我在heroku上推送我的应用程序,我使用cleardb创建数据库,并使用用于创建表的软件(navicat premium)对其进行配置。
I start my program, which works really well on local side, and when I try to access to my database I get this error : 我启动我的程序,该程序在本地非常有效,当我尝试访问数据库时,出现此错误:
ER_ACCESS_DENIED_ERROR: Access denied for user 'xxxxxxxx'@'ip-xx-xx-xx-xxx.us-westxxxxxxxxxx' (using password: YES)
ER_ACCESS_DENIED_ERROR:用户'xxxxxxxx'@'ip-xx-xx-xx-xxx.us-westxxxxxxxxxx'的访问被拒绝(使用密码:是)
I have read that's maybe the port but I defined it like on navicat. 我读过也许是港口,但我像在navicat上定义了它。
This is my configuration : 这是我的配置:
connection: {
port : '3306',
host : 'us-westxxxxxxxxxx',
user : 'xxxxxxxx',
password : 'xxxxxxxx',
database : 'xxxxxxxx',
charset :'utf8'
}
My configuration is good so I really don't know where is the error. 我的配置很好,所以我真的不知道错误在哪里。
Thanks for helping ! 感谢您的帮助!
Check the endpoint data for ClearDB as your endpoint url looks dramatically different to what I would expect. 检查ClearDB的端点数据,因为端点URL看起来与我期望的截然不同。
The host is the piece after the @. 主机是@之后的部分。
CLEARDB_DATABASE_URL => mysql://[username]:[password]@[host]/[database name]?reconnect=true
One thing I notice is that you specify the port (I don't do this and it works) and you specify the port as a string not a number, so if you do specify it, that might be why. 我注意到的一件事是,您指定了端口(我不这样做并且它可以工作),并且将端口指定为字符串而不是数字,因此,如果您指定它,这可能就是原因。
Lastly: 最后:
I would also suggest you store some of that data in Heroku variables and use env.process.VARIABLE_NAME so you do not need to keep any passwords etc in your code/source files. 我还建议您将其中一些数据存储在Heroku变量中,并使用env.process.VARIABLE_NAME,这样就无需在代码/源文件中保留任何密码等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.