# WP Cli question

**URL:** <https://community.localwp.com/t/wp-cli-question/97>\
**Category:** Support\
**Created:** [December 2, 2016, 10:42am UTC](https://community.localwp.com/t/wp-cli-question/97 "2016-12-02T10:42:18Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![clay](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/clay/32/8248_2.png) [@clay](https://community.localwp.com/u/clay)\
**Post date:** [August 4, 2017, 7:15pm UTC](https://community.localwp.com/t/wp-cli-question/97/7 "2017-08-04T19:15:57Z")

</div>

Hi @tedw,

If you’re wanting to run WP-CLI from your computer and not inside the site container, you can try the following:

1. Open `wp-config.php` in `app/public`
2. Add a conditional for the `DB_HOST` constant. The value needs to be whatever the “Remote Host” of the database is followed by the “Remote Port” so it’ll look something like:

```auto
/** MySQL hostname */
if ( defined( 'WP_CLI' ) && WP_CLI ) {
	define( 'DB_HOST', '192.168.65.100:4006' );
} else {
	define( 'DB_HOST', 'localhost' );
}

```

---

_[View the full topic](https://community.localwp.com/t/wp-cli-question/97)._
