• Resolved sander105

    (@sander105)


    I’m using the woocommerce API get some product data, but while doing so I get this database error. What can I do to fix this issue? I tested the api in another application so the api keys are correct.

    So what could cause that the api can’t connect to the database?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi @sander105,

    Do you have a firewall installed on your server or a security extension/plugin that might be blocking the connection to the database? Can you deactivate all plugins except WooCommerce and check if that helps?

    You could also contact your host and check if there are settings on the server blocking the connection.

    If nothing happens by following the suggestions above, in order to narrow down the possible causes of this behavior, you could enable debugging in WordPress following our support documentation:

    https://docs.woocommerce.com/document/woocommerce-product-search/api/debugging/

    Also, PHP error logs can be useful when investigating an issue. You can check WooCommerce fatal errors logs and other error logs in a few possible places on the server:

    https://docs.woocommerce.com/document/finding-php-error-logs/

    Let us know how it goes.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    It’s been a while since we last heard back from you. I’m going to mark this thread as resolved.

    Hopefully, the above information was helpful. If you have further questions, please feel free to open a new topic.

    Cheers.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error establishing a database connection’ is closed to new replies.