镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Add dbhost parameter to wp config create command documentation - #637

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

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

Conversation

@brentmartinmiller

@brentmartinmiller brentmartinmiller commented May 21, 2026 •

Copy link
Copy Markdown

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

Summary by CodeRabbit

  • Documentation
    • Clarified that the database host setting is optional and defaults to localhost.
    • Added guidance for connection errors on Unix-like systems, including macOS, where the default may use a Unix socket. Instructions now include retrying with an explicit TCP host, such as 127.0.0.1:3306.

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.

brentmartinmiller and others added 2 commits May 21, 2026 14:39
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.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6bc9fc00-3b0b-469b-8b56-d5fae14827b7
Commits

Reviewing files that changed from the base of the PR and between 68b25a6 and c7f45b3.

Files selected for processing: 1
  • how-to/how-to-install.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The installation guide updates the wp config create syntax with the optional --dbhost argument. It explains the localhost default, Unix socket behavior, and a TCP host example for connection errors.

Changes: Installation documentation

Layer / File(s) Summary
Document database host options
how-to/how-to-install.md
The command syntax includes optional --dbhost=<dbhost>. The guide explains password prompting, the localhost default, Unix socket behavior, and the TCP fallback.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: swissspidy

Merge Risk: Minimal · up to c7f45

The installation guidance update is safe to merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the PR adds the optional --dbhost parameter to the wp config create syntax in the install documentation. The raw summary confirms the only changed file is how-to/how-t…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the PR adds the optional --dbhost parameter to the wp config create syntax in the install documentation. The raw summary confirms the only changed file is how-to/how-to-install.md, which documents this parameter and the TCP host workaround for connection errors. The title is specific, concise, and matches the PR objectives (PR #637).

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@how-to/how-to-install.md`:
- Line 27: Update the fenced code block in the installation instructions to
include a shell-session language identifier, using console or shell on its
opening fence, while preserving the block contents.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f4125a74-6b87-4131-96e2-0f8539247ec4

📥 Commits

Reviewing files that changed from the base of the PR and between 1191ea5 and 68b25a6.

📒 Files selected for processing (1)
  • how-to/how-to-install.md

Comment thread how-to/how-to-install.md
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
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a language identifier to the fenced code block.

The block contains a shell session but has no language identifier. Change the opening fence to ```console or ```shell so Markdown linting passes MD040.

🧰 Tools
🪛 markdownlint-cli2 (0.23.2)

[warning] 27-27: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@how-to/how-to-install.md` at line 27, Update the fenced code block in the
installation instructions to include a shell-session language identifier, using
console or shell on its opening fence, while preserving the block contents.

Source: Linters/SAST tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants