@@ -11,9 +11,36 @@ Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contr
11
11
12
12
This package implements the following commands:
13
13
14
+ ### wp db
15
+
16
+ Performs basic database operations using credentials stored in wp-config.php.
17
+
18
+ ~~~
19
+ wp db
20
+ ~~~
21
+
22
+ ** EXAMPLES**
23
+
24
+ # Create a new database.
25
+ $ wp db create
26
+ Success: Database created.
27
+
28
+ # Drop an existing database.
29
+ $ wp db drop --yes
30
+ Success: Database dropped.
31
+
32
+ # Reset the current database.
33
+ $ wp db reset --yes
34
+ Success: Database reset.
35
+
36
+ # Execute a SQL query stored in a file.
37
+ $ wp db query < debug.sql
38
+
39
+
40
+
14
41
### wp db create
15
42
16
- Create a new database.
43
+ Creates a new database.
17
44
18
45
~~~
19
46
wp db create
@@ -32,7 +59,7 @@ wp-config.php.
32
59
33
60
### wp db drop
34
61
35
- Delete the existing database.
62
+ Deletes the existing database.
36
63
37
64
~~~
38
65
wp db drop [--yes]
@@ -56,7 +83,7 @@ wp-config.php.
56
83
57
84
### wp db reset
58
85
59
- Remove all tables from the database.
86
+ Removes all tables from the database.
60
87
61
88
~~~
62
89
wp db reset [--yes]
@@ -80,7 +107,7 @@ specified in wp-config.php.
80
107
81
108
### wp db check
82
109
83
- Check the current status of the database.
110
+ Checks the current status of the database.
84
111
85
112
~~~
86
113
wp db check
@@ -102,7 +129,7 @@ for more details on the `CHECK TABLE` statement.
102
129
103
130
### wp db optimize
104
131
105
- Optimize the database.
132
+ Optimizes the database.
106
133
107
134
~~~
108
135
wp db optimize
@@ -124,7 +151,7 @@ for more details on the `OPTIMIZE TABLE` statement.
124
151
125
152
### wp db prefix
126
153
127
- Display the database table prefix.
154
+ Displays the database table prefix.
128
155
129
156
~~~
130
157
wp db prefix
@@ -141,7 +168,7 @@ Display the database table prefix, as defined by the database handler's interpre
141
168
142
169
### wp db repair
143
170
144
- Repair the database.
171
+ Repairs the database.
145
172
146
173
~~~
147
174
wp db repair
@@ -163,7 +190,7 @@ more details on the `REPAIR TABLE` statement.
163
190
164
191
### wp db cli
165
192
166
- Open a MySQL console using credentials from wp-config.php
193
+ Opens a MySQL console using credentials from wp-config.php
167
194
168
195
~~~
169
196
wp db cli [--database=<database>] [--default-character-set=<character-set>] [--<field>=<value>]
@@ -190,7 +217,7 @@ wp db cli [--database=<database>] [--default-character-set=<character-set>] [--<
190
217
191
218
### wp db query
192
219
193
- Execute a SQL query against the database.
220
+ Executes a SQL query against the database.
194
221
195
222
~~~
196
223
wp db query [<sql>] [--<field>=<value>]
@@ -311,7 +338,7 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
311
338
312
339
### wp db import
313
340
314
- Import a database from a file or from STDIN.
341
+ Imports a database from a file or from STDIN.
315
342
316
343
~~~
317
344
wp db import [<file>] [--skip-optimization]
@@ -340,7 +367,7 @@ defined in the SQL.
340
367
341
368
### wp db search
342
369
343
- Find a string in the database.
370
+ Finds a string in the database.
344
371
345
372
~~~
346
373
wp db search <search> [<tables>...] [--network] [--all-tables-with-prefix] [--all-tables] [--before_context=<num>] [--after_context=<num>] [--regex] [--regex-flags=<regex-flags>] [--regex-delimiter=<regex-delimiter>] [--table_column_once] [--one_line] [--matches_only] [--stats] [--table_column_color=<color_code>] [--id_color=<color_code>] [--match_color=<color_code>]
@@ -468,7 +495,7 @@ They can be concatenated. For instance, the default match color of black on a mu
468
495
469
496
### wp db tables
470
497
471
- List the database tables.
498
+ Lists the database tables.
472
499
473
500
~~~
474
501
wp db tables [<table>...] [--scope=<scope>] [--network] [--all-tables-with-prefix] [--all-tables] [--format=<format>]
@@ -524,7 +551,7 @@ Defaults to all tables registered to the $wpdb database handler.
524
551
525
552
### wp db size
526
553
527
- Display the database name and size.
554
+ Displays the database name and size.
528
555
529
556
~~~
530
557
wp db size [--size_format] [--tables] [--format] [--scope=<scope>] [--network] [--all-tables-with-prefix] [--all-tables]
0 commit comments