wp-cli: Error establishing a database connection

If I run the command:

# wp site archive 149 --allow-root

I get: “Error establishing a database connection”

If I run this command it works fine:

# wp db query 'SHOW TABLES' --allow-root | more
Tables_in_blogs
wp_1002_layerslider
wp_1004_podpress_statcounts
wp_1004_podpress_stats
wp_1008_fs_data
wp_1008_fs_visits
.....

The database is not in the same server where wordpress is installed.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

Oh. Can you try wp option get home --url=domain.com, where domain.com is a site on your network?