So I am working with Loopback (Node.js framework) for the first time and I tried to set up a Mysql model. I've installed Loopback globally, and also installed the mysql connector with npm. After that, I tried to add a datasource with the mysql connector. I tried to use my MAMP localhost database.
Unfortunatly I get an error when I try to connect with loopback again typing the node .
command. The error: Error: connect ECONNREFUSED 127.0.0.1:3306
.
So I did some research and many people answered on different node questions saying you have to add the socket of MAMP to your config in order to get a connection. So I tried to add that but that doesn't seem to work or I am not doing it right, because, I can't find the proper way of doing it. Here is my datasource:
"db": {
"host": "127.0.0.1",
"port": "3306",
"url": "",
"database": "meetups",
"password": "root",
"name": "root",
"user": "root",
"connector": "mysql"
}
And I tried to add "socketPath": "/var/run/mysqld/mysqld.sock"
and "socket": "/var/run/mysqld/mysqld.sock"
but that doesn't seem to work. Is there anybody out there with exp. in node.js / loopback?