Connecting to the database from terminal on windows

What issue or error are you experiencing?

I’m using cline and gemini within visual studio code to experiment creating features within wordpress. The issue I’m coming up against is that cline is trying to run a command to register a theme but it gets the following error. Here is the command and error:

$ wp --path=app/public theme enable qr-code-theme
Error: Error establishing a database connection.

The site is running and I can access the database via the database button on local. Any ideas how to solve this?


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version:

  • Operating System (OS) and OS version:
    Windows 11


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @codescribler!

Some common things we often see for Windows users are that there are either security/permission blockers or competing applications. Obviously, Local seems to be running okay at the moment, but could there be anything else inhibiting your other programs?

Has this ever worked for you in the past or was this your first attempt?