wp db import <file>

Imports a database from a file or from STDIN

Arguments

NameDescription
fileThe name of the SQL file to import. If ‘-‘, then reads from STDIN. If omitted, it will look for ‘{dbname}.sql’

Options

NameDescription
--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 binary docs
--skip-optimizationWhen using an SQL file, do not include speed optimization such as disabling auto-commit and key checks
--defaultsLoads the environment’s MySQL option files. Default behavior is to skip loading them to avoid failures due to misconfiguration