MySQL Can Connect Remotely but not Locally

后端 未结 8 1632
迷失自我
迷失自我 2021-01-19 20:29

This is a weird problem and I\'m not sure what\'s going on. I installed MySQL on a linux box I have running Ubuntu 10.04 LTS. I can access mysql via SSH mysql -p

8条回答
  •  生来不讨喜
    2021-01-19 20:57

    Manually defining the socket fixed this problem for me.

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

提交回复
热议问题