Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ wp db cli [--database=<database>] [--default-character-set=<character-set>] [--d
Executes a SQL query against the database.

~~~
wp db query [<sql>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>] [--defaults]
wp db query [<sql>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>] [--defaults] [--skip-sql-mode-compat]
~~~

Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER`
Expand All @@ -365,6 +365,13 @@ entirely.
[--defaults]
Loads the environment's MySQL option files. Default behavior is to skip loading them to avoid failures due to misconfiguration.

[--skip-sql-mode-compat]
Run the query under the server's own SQL modes instead of adapting them to
be WordPress-compatible. By default, the incompatible modes that WordPress
disables in `wpdb` (such as `NO_ZERO_DATE` and `STRICT_TRANS_TABLES`) are
stripped for the session, so statements against WordPress's zero-date schema
behave the same as they do in WordPress itself.

**EXAMPLES**

# Execute a query stored in a file
Expand Down Expand Up @@ -523,7 +530,7 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
Imports a database from a file or from STDIN.

~~~
wp db import [<file>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>] [--skip-optimization] [--defaults]
wp db import [<file>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>] [--skip-optimization] [--skip-sql-mode-compat] [--defaults]
~~~

Runs SQL queries using `DB_HOST`, `DB_NAME`, `DB_USER` and
Expand All @@ -548,6 +555,9 @@ defined in the SQL.
[--skip-optimization]
When using an SQL file, do not include speed optimization such as disabling auto-commit and key checks.

[--skip-sql-mode-compat]
Do not adapt the session SQL mode for WordPress compatibility. By default, `wp db import` strips the SQL modes that WordPress Core disables (such as `STRICT_TRANS_TABLES` and `NO_ZERO_DATE`) so that dumps containing legacy values like `0000-00-00` import cleanly. Pass this flag to import under the server's own SQL modes instead.

[--defaults]
Loads the environment's MySQL option files. Default behavior is to skip loading them to avoid failures due to misconfiguration.

Expand Down
Loading