express-admin icon indicating copy to clipboard operation
express-admin copied to clipboard

Error in Heroku - connect ECONNREFUSED

Open srt199 opened this issue 9 years ago • 4 comments

I have deployed express-admin in Heroku, changing config.json to Heroku DB details and custom.json to have the absolute paths to the files. I also have already imported schema.sql and insert.sql successfully into the Heroku DB.

The logs are showing the next error on initialization: connect ECONNREFUSED 127.0.0.1:3306

This is how my config.json looks like:

{
    "mysql": {
        "hostname": "us-cdbr-iron-east-03.cleardb.net",
        "database": "heroku_******",
        "user": "bf********",
        "password": "49*******"
    },
    "server": {
        "port": 3306
    },
    "app": {
        "layouts": true,
        "themes": true,
        "languages": true
    }

This is the command used to initialize the app in Heroku: admin config/mysql/

I have added "express-admin" to the package.json file and executed "npm install" without problems.

Thanks in advance.

srt199 avatar Feb 02 '16 12:02 srt199

Same issue for me, were you able to resolve it @srt199?

jforaker avatar Jun 12 '16 05:06 jforaker

Hi, the problem is not the connection with the db(in fact the port that you have set is the port where the application listens not the db). Probably there's something wrong in the root file. You have to post your index.js file.

Spezia88 avatar Oct 30 '16 20:10 Spezia88

node-mysql's connection options doesn't support key "hostname", use "host" instead.

{
    "mysql": {
        "host": "us-cdbr-iron-east-03.cleardb.net",
        "database": "heroku_******",
        "user": "bf********",
        "password": "49*******"
    },
    "server": {
        "port": 3306
    },
    "app": {
        "layouts": true,
        "themes": true,
        "languages": true
    }

Works fine in my case.

smbdsbrain avatar Jan 29 '18 13:01 smbdsbrain

Got the same problem(((

Slava-stack avatar Aug 04 '22 00:08 Slava-stack