studio24 / wordpress-multi-env-config

WordPress multi-environment config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wp cli database error

filipvanreeth opened this issue · comments

When I use ex. wp plugin list with wp-cli I get this error:

Error:

Error establishing a database connection

This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at . This could mean your host's database server is down.

  • Are you sure you have the correct username and password?
  • Are you sure that you have typed the correct hostname?
  • Are you sure that the database server is running?

If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

Any idea how to fix this?

Sorry I've not replied earlier to this.

You need to pass the environment to the wp-cli command to ensure the correct config file is loaded. This can be done as so:

wp help --env=development

See the README for more
https://github.com/studio24/wordpress-multi-env-config/blob/master/README.md

If it still isn't working for you after you add the --env option please let me know.

Hi Simon,

Thanks.

Kind regards,
Filip

On 23 Mar 2016, at 19:24, Simon R Jones notifications@github.com wrote:

Sorry I've not replied earlier to this.

You need to pass the environment to the wp-cli command to ensure the correct config file is loaded. This can be done as so:

wp help --env=development

See the README for more
https://github.com/studio24/wordpress-multi-env-config/blob/master/README.md https://github.com/studio24/wordpress-multi-env-config/blob/master/README.md
If it still isn't working for you after you add the --env option please let me know.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #8 (comment)

Marking as closed, let me know if you have any further issues