简体   繁体   English

heroku节点js cleardb mysql失败:ER_ACCESS_DENIED_ERROR:用户的访问被拒绝

[英]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.

相关问题 错误:ER_ACCESS_DENIED_ERROR:拒绝用户访问。 无法使用 Node JS 连接到远程数据库 - Error: ER_ACCESS_DENIED_ERROR: Access denied for user. Unable to Connect to Remote Database using Node JS 以编程方式连接到RDS MySQL(NodeJs,Java) - ER_ACCESS_DENIED_ERROR:拒绝用户访问 - Connect to RDS MySQL programatically (NodeJs, Java) - ER_ACCESS_DENIED_ERROR: Access denied for user nodejs express重新连接mysql ER_ACCESS_DENIED_ERROR:用户''@'localhost'的访问被拒绝(使用密码:否) - nodejs express reconnect mysql ER_ACCESS_DENIED_ERROR: Access denied for user ''@'localhost' (using password: NO) NodeJS/mySQL - ER_ACCESS_DENIED_ERROR 用户 'root'@'localhost' 的访问被拒绝(使用密码:是) - NodeJS/mySQL - ER_ACCESS_DENIED_ERROR Access denied for user 'root'@'localhost' (using password: YES) ER_ACCESS_DENIED_ERROR CloudSQL - ER_ACCESS_DENIED_ERROR CloudSQL ER_ACCESS_DENIED_ERROR:当我尝试连接到远程服务器上的数据库时 - Node.js - ER_ACCESS_DENIED_ERROR: When i try to connect to the database on remote server - Node.js ER_ACCESS_DENIED_ERROR:nodeJS 上的访问被拒绝 - ER_ACCESS_DENIED_ERROR: Access denied on nodeJS Directus ER_ACCESS_DENIED_ERROR:用户“root”@“localhost”的访问被拒绝(使用密码:是) - Directus ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES) ER_ACCESS_DENIED_ERROR:用户 ''@'localhost' 的访问被拒绝(使用密码:NO) - ER_ACCESS_DENIED_ERROR: Access denied for user ''@'localhost' (using password: NO) 无法使用MySQL(8.0.15)对我的Node js(v10.15.3)应用,npm mysql(v2.17.1)进行身份验证(ER_ACCESS_DENIED_ERROR) - Not able to authenticate my Node js(v10.15.3) app, npm mysql (v2.17.1) with MySQL(8.0.15) (ER_ACCESS_DENIED_ERROR)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM