Wordpress custom plugin integration

Howdy,

I have made a custom plugin to integrate with wordpress, using the instructions found here: Setting up Algolia | WordPress | Algolia

Pretty sure I did all that correctly, as I don’t have any errors haha.

I then moved on to the instructions found here: Importing existing content | WordPress | Algolia

But I must have done something incorrectly here, because when I try to run "wp algolia reindex_post
" in the terminal at the end I get the error, “Error establishing a database connection”.

I’m kinda a novice here, so I feel like my troubleshooting methods on my own are limited. I tried running the command in my plugin root as well as site root. I’ve also attempted to find similar issues, but the only thing I’ve seen and tried is changing my DB_HOST to 127.0.0.1 instead of localhost.

Suggestions for troubleshooting, or even better a link to another tutorial like the ones above, would be greatly appreciated. Thanks!

If you’re using something like Local by Flywheel, or similar, for your local hosting, you’ll probably want to use the shell command options in Local by Flywheel to connect into the virtual machine running everything. As is, it sounds like it’s trying to connect via your local computer, where the setup is not located at.

I am using MAMP Pro, just for a bit more context.

Did you ever get this resolved?