From f8b103e5eb42ff568520106d2bbf857f86404550 Mon Sep 17 00:00:00 2001 From: Brent Martin Miller Date: Thu, 21 May 2026 13:14:08 -0400 Subject: [PATCH 1/2] Add dbhost parameter to config creation command Updated command syntax to include database host parameter and clarified instructions for replacing placeholders. --- how-to/how-to-install.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/how-to/how-to-install.md b/how-to/how-to-install.md index 1d74b467..b181d779 100644 --- a/how-to/how-to-install.md +++ b/how-to/how-to-install.md @@ -22,15 +22,15 @@ desired folder name and the `--locale=it_IT` with your desired locale. You can o 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= --dbuser= [--dbpass=]` +The basic syntax of the command is the following: `wp config create --dbname= --dbuser= --dbhost= [--dbpass=]` ``` - $ wp config create --dbname=your_db_name_here --dbuser=your_db_user_here --prompt=dbpass + $ wp config create --dbname=your_db_name_here --dbuser=your_db_user_here --dbhost=your_db_host --prompt=dbpass 1/10 [--dbpass=]: type_your_password Success: Generated 'wp-config.php' file. ``` -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=]:` +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=]:` ### Step 3 - Create the database From 059ea32ff28c8468a56b52b70ca6a126aa53e4f9 Mon Sep 17 00:00:00 2001 From: Brent Martin Miller Date: Thu, 21 May 2026 14:39:13 -0400 Subject: [PATCH 2/2] Update instructions for wp config create 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. --- how-to/how-to-install.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/how-to/how-to-install.md b/how-to/how-to-install.md index b181d779..3c2e9c34 100644 --- a/how-to/how-to-install.md +++ b/how-to/how-to-install.md @@ -22,15 +22,17 @@ desired folder name and the `--locale=it_IT` with your desired locale. You can o 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= --dbuser= --dbhost= [--dbpass=]` +The basic syntax of the command is the following: `wp config create --dbname= --dbuser= [--dbhost=] [--dbpass=]` ``` - $ wp config create --dbname=your_db_name_here --dbuser=your_db_user_here --dbhost=your_db_host --prompt=dbpass + $ wp config create --dbname=your_db_name_here --dbuser=your_db_user_here --prompt=dbpass 1/10 [--dbpass=]: type_your_password Success: Generated 'wp-config.php' file. ``` -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=]:` +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=]:`. + +The `--dbhost` parameter is optional and defaults to `localhost`. On Unix-like systems, including macOS, MySQL treats `localhost` as a Unix socket connection rather than TCP. If you encounter a connection error, rerun the command with an explicit TCP host, for example: `--dbhost=127.0.0.1:3306`. ### Step 3 - Create the database