wp db query <sql>
Executes a SQL query against the database
Arguments
Name | Description |
---|---|
sql | A SQL query. If not passed, will try to read from STDIN |
Options
Name | Description |
---|---|
--dbuser <value> | Username to pass to mysql. Defaults to DB_USER |
--dbpass <value> | Password to pass to mysql. Defaults to DB_PASSWORD |
--field=value | Extra arguments to pass to mysql. Refer to mysql docs |
--defaults | Loads the environment’s MySQL option files. Default behavior is to skip loading them to avoid failures due to misconfiguration |