You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for more details on the `OPTIMIZE TABLE` statement.
144
175
176
+
**OPTIONS**
177
+
178
+
[--dbuser=<value>]
179
+
Username to pass to mysqlcheck. Defaults to DB_USER.
180
+
181
+
[--dbpass=<value>]
182
+
Password to pass to mysqlcheck. Defaults to DB_PASSWORD.
183
+
184
+
[--<field>=<value>]
185
+
Extra arguments to pass to mysqlcheck.
186
+
145
187
**EXAMPLES**
146
188
147
189
$ wp db optimize
@@ -171,7 +213,7 @@ Display the database table prefix, as defined by the database handler's interpre
171
213
Repairs the database.
172
214
173
215
~~~
174
-
wp db repair
216
+
wp db repair [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>]
175
217
~~~
176
218
177
219
Runs `mysqlcheck` utility with `--repair=true` using `DB_HOST`,
@@ -181,6 +223,17 @@ specified in wp-config.php.
181
223
[See docs](http://dev.mysql.com/doc/refman/5.7/en/repair-table.html) for
182
224
more details on the `REPAIR TABLE` statement.
183
225
226
+
**OPTIONS**
227
+
228
+
[--dbuser=<value>]
229
+
Username to pass to mysqlcheck. Defaults to DB_USER.
230
+
231
+
[--dbpass=<value>]
232
+
Password to pass to mysqlcheck. Defaults to DB_PASSWORD.
233
+
234
+
[--<field>=<value>]
235
+
Extra arguments to pass to mysqlcheck.
236
+
184
237
**EXAMPLES**
185
238
186
239
$ wp db repair
@@ -193,7 +246,7 @@ more details on the `REPAIR TABLE` statement.
193
246
Opens a MySQL console using credentials from wp-config.php
194
247
195
248
~~~
196
-
wp db cli [--database=<database>] [--default-character-set=<character-set>] [--<field>=<value>]
249
+
wp db cli [--database=<database>] [--default-character-set=<character-set>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>]
197
250
~~~
198
251
199
252
**OPTIONS**
@@ -204,8 +257,14 @@ wp db cli [--database=<database>] [--default-character-set=<character-set>] [--<
204
257
[--default-character-set=<character-set>]
205
258
Use a specific character set. Defaults to DB_CHARSET when defined.
206
259
260
+
[--dbuser=<value>]
261
+
Username to pass to mysql. Defaults to DB_USER.
262
+
263
+
[--dbpass=<value>]
264
+
Password to pass to mysql. Defaults to DB_PASSWORD.
265
+
207
266
[--<field>=<value>]
208
-
Extra arguments to pass to the MySQL executable.
267
+
Extra arguments to pass to mysql.
209
268
210
269
**EXAMPLES**
211
270
@@ -220,7 +279,7 @@ wp db cli [--database=<database>] [--default-character-set=<character-set>] [--<
220
279
Executes a SQL query against the database.
221
280
222
281
~~~
223
-
wp db query [<sql>] [--<field>=<value>]
282
+
wp db query [<sql>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>]
224
283
~~~
225
284
226
285
Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER`
@@ -231,6 +290,12 @@ Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER`
231
290
[<sql>]
232
291
A SQL query. If not passed, will try to read from STDIN.
233
292
293
+
[--dbuser=<value>]
294
+
Username to pass to mysql. Defaults to DB_USER.
295
+
296
+
[--dbpass=<value>]
297
+
Password to pass to mysql. Defaults to DB_PASSWORD.
298
+
234
299
[--<field>=<value>]
235
300
Extra arguments to pass to mysql.
236
301
@@ -271,7 +336,7 @@ Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER`
271
336
Exports the database to a file or to STDOUT.
272
337
273
338
~~~
274
-
wp db export [<file>] [--<field>=<value>] [--tables=<tables>] [--exclude_tables=<tables>] [--porcelain]
339
+
wp db export [<file>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>] [--tables=<tables>] [--exclude_tables=<tables>] [--porcelain]
275
340
~~~
276
341
277
342
Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
@@ -283,8 +348,14 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
283
348
The name of the SQL file to export. If '-', then outputs to STDOUT. If
284
349
omitted, it will be '{dbname}-{Y-m-d}-{random-hash}.sql'.
285
350
351
+
[--dbuser=<value>]
352
+
Username to pass to mysqldump. Defaults to DB_USER.
353
+
354
+
[--dbpass=<value>]
355
+
Password to pass to mysqldump. Defaults to DB_PASSWORD.
356
+
286
357
[--<field>=<value>]
287
-
Extra arguments to pass to mysqldump
358
+
Extra arguments to pass to mysqldump.
288
359
289
360
[--tables=<tables>]
290
361
The comma separated list of specific tables to export. Excluding this parameter will export all tables in the database.
@@ -341,7 +412,7 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
341
412
Imports a database from a file or from STDIN.
342
413
343
414
~~~
344
-
wp db import [<file>] [--skip-optimization]
415
+
wp db import [<file>] [--dbuser=<value>] [--dbpass=<value>] [--skip-optimization]
345
416
~~~
346
417
347
418
Runs SQL queries using `DB_HOST`, `DB_NAME`, `DB_USER` and
@@ -354,6 +425,12 @@ defined in the SQL.
354
425
[<file>]
355
426
The name of the SQL file to import. If '-', then reads from STDIN. If omitted, it will look for '{dbname}.sql'.
356
427
428
+
[--dbuser=<value>]
429
+
Username to pass to mysql. Defaults to DB_USER.
430
+
431
+
[--dbpass=<value>]
432
+
Password to pass to mysql. Defaults to DB_PASSWORD.
433
+
357
434
[--skip-optimization]
358
435
When using an SQL file, do not include speed optimization such as disabling auto-commit and key checks.
359
436
@@ -437,35 +514,38 @@ Defaults to searching through all tables registered to $wpdb. On multisite, this
437
514
Percent color code to use for the match (unless both before and after context are 0, when no color code is used). For a list of available percent color codes, see below. Default '%3%k' (black on a mustard background).
438
515
439
516
The percent color codes available are:
440
-
'%y' Yellow (dark) (mustard)
441
-
'%g' Green (dark)
442
-
'%b' Blue (dark)
443
-
'%r' Red (dark)
444
-
'%m' Magenta (dark)
445
-
'%c' Cyan (dark)
446
-
'%w' White (dark) (light gray)
447
-
'%k' Black
448
-
'%Y' Yellow (bright)
449
-
'%G' Green (bright)
450
-
'%B' Blue (bright)
451
-
'%R' Red (bright)
452
-
'%M' Magenta (bright)
453
-
'%C' Cyan (bright)
454
-
'%W' White
455
-
'%K' Black (bright) (dark gray)
456
-
'%3' Yellow background (dark) (mustard)
457
-
'%2' Green background (dark)
458
-
'%4' Blue background (dark)
459
-
'%1' Red background (dark)
460
-
'%5' Magenta background (dark)
461
-
'%6' Cyan background (dark)
462
-
'%7' White background (dark) (light gray)
463
-
'%0' Black background
464
-
'%8' Reverse
465
-
'%U' Underline
466
-
'%F' Blink (unlikely to work)
467
-
468
-
They can be concatenated. For instance, the default match color of black on a mustard (dark yellow) background '%3%k' can be made black on a bright yellow background with '%Y%0%8'.
517
+
518
+
| Code | Color
519
+
| ---- | -----
520
+
| %y | Yellow (dark) (mustard)
521
+
| %g | Green (dark)
522
+
| %b | Blue (dark)
523
+
| %r | Red (dark)
524
+
| %m | Magenta (dark)
525
+
| %c | Cyan (dark)
526
+
| %w | White (dark) (light gray)
527
+
| %k | Black
528
+
| %Y | Yellow (bright)
529
+
| %G | Green (bright)
530
+
| %B | Blue (bright)
531
+
| %R | Red (bright)
532
+
| %M | Magenta (bright)
533
+
| %C | Cyan (bright)
534
+
| %W | White
535
+
| %K | Black (bright) (dark gray)
536
+
| %3 | Yellow background (dark) (mustard)
537
+
| %2 | Green background (dark)
538
+
| %4 | Blue background (dark)
539
+
| %1 | Red background (dark)
540
+
| %5 | Magenta background (dark)
541
+
| %6 | Cyan background (dark)
542
+
| %7 | White background (dark) (light gray)
543
+
| %0 | Black background
544
+
| %8 | Reverse
545
+
| %U | Underline
546
+
| %F | Blink (unlikely to work)
547
+
548
+
They can be concatenated. For instance, the default match color of black on a mustard (dark yellow) background `%3%k` can be made black on a bright yellow background with `%Y%0%8`.
469
549
470
550
**EXAMPLES**
471
551
@@ -512,7 +592,7 @@ Defaults to all tables registered to the $wpdb database handler.
512
592
Can be all, global, ms_global, blog, or old tables. Defaults to all.
513
593
514
594
[--network]
515
-
List all the tables in a multisite install. Overrides --scope=<scope>.
595
+
List all the tables in a multisite install.
516
596
517
597
[--all-tables-with-prefix]
518
598
List all tables that match the table prefix even if not registered on $wpdb. Overrides --network.
@@ -570,6 +650,8 @@ The size defaults to a human-readable number.
570
650
- b (bytes)
571
651
- kb (kilobytes)
572
652
- mb (megabytes)
653
+
- gb (gigabytes)
654
+
- tb (terabytes)
573
655
---
574
656
575
657
[--tables]
@@ -589,7 +671,7 @@ The size defaults to a human-readable number.
589
671
Can be all, global, ms_global, blog, or old tables. Defaults to all.
590
672
591
673
[--network]
592
-
List all the tables in a multisite install. Overrides --scope=<scope>.
674
+
List all the tables in a multisite install.
593
675
594
676
[--all-tables-with-prefix]
595
677
List all tables that match the table prefix even if not registered on $wpdb. Overrides --network.
0 commit comments