simov / express-admin

MySQL, MariaDB, PostgreSQL, SQLite admin for Node.js
MIT License
1.18k stars 223 forks source link

Error in Heroku - connect ECONNREFUSED #99

Open srt199 opened 8 years ago

srt199 commented 8 years ago

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.

jforaker commented 8 years ago

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

Spezia88 commented 7 years ago

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.

smbdsbrain commented 6 years ago

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.

Slava-stack commented 2 years ago

Got the same problem(((