Error: connect ECONNREFUSED 127.0.0.1:3306

I checked. None of my other MySQL dbs from Laragon or Xampp are running.

$ strapi develop
[2022-01-22 15:21:24.957] debug: ⛔️ Server wasn't able to start properly.
[2022-01-22 15:21:24.959] error: connect ECONNREFUSED 127.0.0.1:3306
Error: connect ECONNREFUSED 127.0.0.1:3306
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)
    --------------------
    at Protocol._enqueue (C:\react\my-strapi2\node_modules\mysql\lib\protocol\Protocol.js:144:48)
    at Protocol.handshake (C:\react\my-strapi2\node_modules\mysql\lib\protocol\Protocol.js:51:23)
    at Connection.connect (C:\react\my-strapi2\node_modules\mysql\lib\Connection.js:116:18)
    at C:\react\my-strapi2\node_modules\knex\lib\dialects\mysql\index.js:56:18
    at new Promise (<anonymous>)
    at Client_MySQL.acquireRawConnection (C:\react\my-strapi2\node_modules\knex\lib\dialects\mysql\index.js:51:12)
    at create (C:\react\my-strapi2\node_modules\knex\lib\client.js:237:39)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
1 Like

Am I supposed to install and run a separate MySQL? I was assuming it comes together in the whole strapi package? I went through the CLI installation and entered my desired username “root” and password as blank. So I thought it’s creating a db for me.

Yup. I have to have my own MySQL and run it outside npm and strapi folder.