In MAMP, you go to http://localhost:8888/MAMP, and you find:/Applications/MAMP/tmp/mysql/mysql.sock最后,您有:var connection = mysql.createConnection({ host : config.host, user : config.user, password : config.pass, database : config.db, socketPath: '/Applications/MAMP/tmp/mysql/mysql.sock'}); 这篇关于Node.js MySQL-错误:连接ECONNREFUSED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-24 18:56