connect ECONNREFUSED – node js , sql

I know two ways to solve it:

  1. In mysql.conf, comment skip-networking.

  2. Try to set the socket like this:

    var client = mysql.createClient({
    user: uuuu,
    password: pppp,
    host: '127.0.0.1',
    port: '3306',
    _socket: '/var/run/mysqld/mysqld.sock',});
    

Leave a Comment