npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

mysqldump : Error: connect ETIMEDOUT

Hello, I installed this wordpress project on my computer running with MAMP. I’m new to npm and Gulp but I installed them on this project. Now I’d like to add a gulp task to save the database using mysqldump (I install this too). I added a task in gulpfile.js, it’s almost ok I think, but I get an error : (node:41835) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT

I’ve searched a bit about ETIMEDOUT but don’t find my case and still not sure to know what to search.

Does anyone knows what to do?

Most likely your mysql daemon is not running, or the the credentials are not set correctly in your task.

Hi Markus,
Thanks for your reply.
MAMP is running, and I can see the website on a browser on localhost:8888/MYSITE/.
I figure out the port I was using was a string in place of a number in my code, but it doesn’t solve the problem.

Here is a snapshot of the MAMP settings
Here is what I have in my code :
host : ‘localhost’,
port : 8888,
user : ‘root’,
password : ‘root’,
database : ‘MC2018’

If I use 8888 as port, I get a ETIMEDOUT error,
If I use 3306 as port (as written on MAMP webstart page) I get this error : “Error: connect ECONNREFUSED”
as it may help, here is the entire error message :

[16:48:48] Using gulpfile /PROJECTPATH/gulpfile.js
[16:48:48] Starting 'dumpDatabase'...
(node:44814) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT
at Object.createConnection (/PROJECTPATH/node_modules/mysql2/promise.js:31:31)
at Function.<anonymous> (/PROJECTPATH/node_modules/mysqldump/dist/cjs.js:631:51)
at (<anonymous>)
at /PROJECTPATH/node_modules/mysqldump/dist/cjs.js:43:71
at new Promise (<anonymous>)
at __awaiter (/PROJECTPATH/node_modules/mysqldump/dist/cjs.js:39:12)
at Function.connect (/PROJECTPATH/node_modules/mysqldump/dist/cjs.js:630:16)
at /PROJECTPATH/node_modules/mysqldump/dist/cjs.js:776:35
at (<anonymous>)
at /PROJECTPATH/node_modules/mysqldump/dist/cjs.js:43:71
at new Promise (<anonymous>)
at __awaiter (/PROJECTPATH/node_modules/mysqldump/dist/cjs.js:39:12)
at main (/PROJECTPATH/node_modules/mysqldump/dist/cjs.js:746:12)
at Promise (/PROJECTPATH/gulpfile.js:200:3)
at new Promise (<anonymous>)
at Gulp.gulp.task (/PROJECTPATH/gulpfile.js:199:12)
at module.exports (/PROJECTPATH/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/PROJECTPATH/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/PROJECTPATH/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/PROJECTPATH/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
(node:44814) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:44814) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.