0

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.

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)

I have read that's maybe the port but I defined it like on 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 !

taspai
  • 120
  • 1
  • 3
  • 13

1 Answers1

0

Check the endpoint data for ClearDB as your endpoint url looks dramatically different to what I would expect.

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.

dhj
  • 4,780
  • 5
  • 20
  • 41