wp db cli

Opens a MySQL console using credentials from wp-config.php

Options

NameDescription
--database <database>Use a specific database. Defaults to DB_NAME
--default-character-set <character-set>Use a specific character set. Defaults to DB_CHARSET when defined
--dbuser <value>Username to pass to mysql. Defaults to DB_USER
--dbpass <value>Password to pass to mysql. Defaults to DB_PASSWORD
--field=valueExtra arguments to pass to mysql. Refer to mysql docs
--defaultsLoads the environment’s MySQL option files. Default behavior is to skip loading them to avoid failures due to misconfiguration