Wp db cli (WP-CLI)
Naar navigatie springen
Naar zoeken springen
NAME wp db cli DESCRIPTION Opens a MySQL console using credentials from wp-config.php SYNOPSIS wp db cli [--database=<database>] [--default-character-set=<character-set>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>] [--defaults] ALIAS connect OPTIONS [--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>=<value>] Extra arguments to pass to mysql. [Refer to mysql docs](https://dev.mysql.com/doc/en/mysql-command-options.html). [--defaults] Loads the environment's MySQL option files. Default behavior is to skip loading them to avoid failures due to misconfiguration. EXAMPLES # Open MySQL console $ wp db cli mysql>
Example
$ wp db connect Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 109921 Server version: 10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.