Skip to content

Add dbhost parameter to wp config create command documentation#637

Open
brentmartinmiller wants to merge 2 commits into
wp-cli:mainfrom
brentmartinmiller:patch-1
Open

Add dbhost parameter to wp config create command documentation#637
brentmartinmiller wants to merge 2 commits into
wp-cli:mainfrom
brentmartinmiller:patch-1

Conversation

@brentmartinmiller
Copy link
Copy Markdown

@brentmartinmiller brentmartinmiller commented May 21, 2026

Updated command syntax documentation to include database host parameter and clarified instructions for replacing placeholders.

Updated command syntax to include database host parameter and clarified instructions for replacing placeholders.
@brentmartinmiller brentmartinmiller requested a review from a team as a code owner May 21, 2026 17:14
@brentmartinmiller brentmartinmiller changed the title Add dbhost parameter to config creation command Add dbhost parameter to wp config create command documentation May 21, 2026
Comment thread how-to/how-to-install.md Outdated
In this step, we will generate a config file and set up the database
credentials for our installation.
The basic syntax of the command is the following: `wp config create --dbname=<dbname> --dbuser=<dbuser> [--dbpass=<dbpass>]`
The basic syntax of the command is the following: `wp config create --dbname=<dbname> --dbuser=<dbuser> --dbhost=<dbhost> [--dbpass=<dbpass>]`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dbhost is optional and thus needs square brackets.

FWIW, all the other arguments are optional too nowadays, if using SQLite. See https://github.com/wp-cli/config-command/#wp-config-create

Comment thread how-to/how-to-install.md Outdated
```

The command above generates the `wp-config.php` file and adds to it the database credentials that you passed. Make sure to replace `your_db_name_here` with the name you want to assign to the database, replace `your_db_user_here` with your database user and type the database password when prompted with the following: `1/10 [--dbpass=<dbpass>]:`
The command above generates the `wp-config.php` file and adds to it the database credentials that you passed. Make sure to replace `your_db_name_here` with the name you want to assign to the database, replace `your_db_user_here` with your database user, replace `your_db_host` with your database host (e.g., 127.0.0.1:3306) and type the database password when prompted with the following: `1/10 [--dbpass=<dbpass>]:`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add a suggestion here to simply check wp config create --help to see how to use it. Less repetitive.

Clarified the command syntax for generating the config file by making the --dbhost parameter optional. Added information about the default behavior of the --dbhost parameter on Unix-like systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants