ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

I am using Wp cli to help with migrating non Wp sites to Wordpress.

Several commands have worked without trouble but the Wp db commands are throwing a can’t connect to database error as shown in heading.

Hi @Camilla Can you share some of the commands you’ve tried? Can you also share a copy of your Local Log? Retrieving Local’s Log File

Thanks, the local log is attached. To be honest I have gone down a different route since posting, namely creating a plug-in to do the database work using created files and we may stick with that.

However the commands I tried were wp db cli (to avoid having anything else causing errors}

wp db query with various queries (no longer have exact attempts)

wp db tables - this just gave me the basic wp tables not the custom ones

Thanks for responding.

With best wishes

Camilla (22.5 KB)

Hi @Camilla!

The full error in the log looks like this:

{"thread":"main","service":{},"serviceBinVersion":{},"stack":"Error: Command failed: %%resourcesPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqladmin.exe ping\n\u0007mysqladmin: connect to server at '::1' failed\r\nerror: 'Can't connect to MySQL server on '::1' (10061)'\r\nCheck that mysqld is running on ::1 and that the port is 10012.\r\nYou can check this by doing 'telnet ::1 10012'\r\n\n    at ChildProcess.exithandler (child_process.js:317:12)\n    at ChildProcess.emit (events.js:315:20)\n    at ChildProcess.EventEmitter.emit (domain.js:467:12)\n    at maybeClose (internal/child_process.js:1048:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)","level":"error","message":"Database did NOT respond to ping after 15 tries.","timestamp":"2022-05-31T09:12:50.824Z"}

It seems like there might be a port connect error going on. You could start here if you wanted to do some further troubleshooting but if your workaround is helping for now you could stick with that. What is Router Mode? - Local

Thanks Nick


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.