-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Always ECONNREFUSED #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Are you sure your local mysql server listens on tcp/localhost? Could you try to connect with command line client:
|
Yes, this works perfectly. |
try to connect with |
@jerodev just to make sure we are all on the same page, you did in fact include |
Thanks for all the help! I have tried using localhost and 127.0.0.1 and both worked with the mysql command but not with node. Could you tell me how to use the socketPath option? |
Make sure that you are using same socket path as your server use ( you can get it with |
I installed libmysqlclient-dev and used the socket to connect to the database. The script is now running fine. Thank you! :) |
Hi,
I am using this in combination with sockets to read messages and put them in the database. But somehow it won't connect to the database. I am 100% sure the connection details are correct. But every time I run the script I get the following output:
We have liftoff!
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
fatal: true }
This is the script I use:
var mysql = require("mysql");
var connection = mysql.createConnection({
host: 'localhost',
user: '',
password: '',
database: ''
});
The text was updated successfully, but these errors were encountered: