Wp db import (WP-CLI)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

  wp db import


  Imports a database from a file or from STDIN.


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

  Runs SQL queries using `DB_HOST`, `DB_NAME`, `DB_USER` and
  `DB_PASSWORD` database credentials specified in wp-config.php. This
  does not create database by itself and only performs whatever tasks are
  defined in the SQL.


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

    Username to pass to mysql. Defaults to DB_USER.

    Password to pass to mysql. Defaults to DB_PASSWORD.

    Extra arguments to pass to mysql. [Refer to mysql binary

    When using an SQL file, do not include speed optimization such as disabling auto-commit and key checks.

    Loads the environment's MySQL option files. Default behavior is to skip loading them to avoid failures due to


    # Import MySQL from a file.
    $ wp db import wordpress_dbase.sql
    Success: Imported from 'wordpress_dbase.sql'.