forked from hanchuanchuan/inception
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmysql.1
3215 lines (3215 loc) · 64.9 KB
/
mysql.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'\" t
.\" Title: \fBmysql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
.\" Date: 01/22/2013
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
.TH "\FBMYSQL\FR" "1" "01/22/2013" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.\" mysql
.\" command-line tool
.\" tools: command-line
.\" scripts: SQL
.\" SQL scripts
.\" batch SQL files
.SH "NAME"
mysql \- the MySQL command\-line tool
.SH "SYNOPSIS"
.HP \w'\fBmysql\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIdb_name\fR\fR\ 'u
\fBmysql [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR
.SH "DESCRIPTION"
.PP
\fBmysql\fR
is a simple SQL shell with input line editing capabilities\&. It supports interactive and noninteractive use\&. When used interactively, query results are presented in an ASCII\-table format\&. When used noninteractively (for example, as a filter), the result is presented in tab\-separated format\&. The output format can be changed using command options\&.
.PP
If you have problems due to insufficient memory for large result sets, use the
\fB\-\-quick\fR
option\&. This forces
\fBmysql\fR
to retrieve results from the server a row at a time rather than retrieving the entire result set and buffering it in memory before displaying it\&. This is done by returning the result set using the
mysql_use_result()
C API function in the client/server library rather than
mysql_store_result()\&.
.PP
Using
\fBmysql\fR
is very easy\&. Invoke it from the prompt of your command interpreter as follows:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmysql \fR\fB\fIdb_name\fR\fR
.fi
.if n \{\
.RE
.\}
.PP
Or:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmysql \-\-user=\fR\fB\fIuser_name\fR\fR\fB \-\-password=\fR\fB\fIyour_password\fR\fR\fB \fR\fB\fIdb_name\fR\fR
.fi
.if n \{\
.RE
.\}
.PP
Then type an SQL statement, end it with
\(lq;\(rq,
\eg, or
\eG
and press Enter\&.
.PP
Typing Control+C causes
\fBmysql\fR
to attempt to kill the current statement\&. If this cannot be done, or Control+C is typed again before the statement is killed,
\fBmysql\fR
exits\&. Previously, Control+C caused
\fBmysql\fR
to exit in all cases\&.
.PP
You can execute SQL statements in a script file (batch file) like this:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmysql \fR\fB\fIdb_name\fR\fR\fB < \fR\fB\fIscript\&.sql\fR\fR\fB > \fR\fB\fIoutput\&.tab\fR\fR
.fi
.if n \{\
.RE
.\}
.PP
On Unix, the
\fBmysql\fR
client writes a record of executed statements to a history file\&. See
the section called \(lqMYSQL HISTORY FILE\(rq\&.
.SH "MYSQL OPTIONS"
.\" mysql command options
.\" command options: mysql
.\" options: command-line: mysql
.\" startup parameters: mysql
.PP
\fBmysql\fR
supports the following options, which can be specified on the command line or in the
[mysql]
and
[client]
groups of an option file\&.
\fBmysql\fR
also supports the options for processing option files described at
Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: help option
.\" help option: mysql
\fB\-\-help\fR,
\fB\-?\fR
.sp
Display a help message and exit\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: auto-rehash option
.\" auto-rehash option: mysql
\fB\-\-auto\-rehash\fR
.sp
Enable automatic rehashing\&. This option is on by default, which enables database, table, and column name completion\&. Use
\fB\-\-disable\-auto\-rehash\fR
to disable rehashing\&. That causes
\fBmysql\fR
to start faster, but you must issue the
rehash
command if you want to use name completion\&.
.sp
To complete a name, enter the first part and press Tab\&. If the name is unambiguous,
\fBmysql\fR
completes it\&. Otherwise, you can press Tab again to see the possible names that begin with what you have typed so far\&. Completion does not occur if there is no default database\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: auto-vertical-output option
.\" auto-vertical-output option: mysql
\fB\-\-auto\-vertical\-output\fR
.sp
Cause result sets to be displayed vertically if they are too wide for the current window, and using normal tabular format otherwise\&. (This applies to statements terminated by
;
or
\eG\&.)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: batch option
.\" batch option: mysql
\fB\-\-batch\fR,
\fB\-B\fR
.sp
Print results using tab as the column separator, with each row on a new line\&. With this option,
\fBmysql\fR
does not use the history file\&.
.sp
Batch mode results in nontabular output format and escaping of special characters\&. Escaping may be disabled by using raw mode; see the description for the
\fB\-\-raw\fR
option\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: binary-mode option
.\" binary-mode option: mysql
\fB\-\-binary\-mode\fR
.sp
This option helps when processing
\fBmysqlbinlog\fR
output that may contain
BLOB
values\&. By default,
\fBmysql\fR
translates
\er\en
in statement strings to
\en
and interprets
\e0
as the statement terminator\&.
\fB\-\-binary\-mode\fR
disables both features\&. It also disables all
\fBmysql\fR
commands except
charset
and
delimiter
in non\-interactive mode (for input piped to
\fBmysql\fR
or loaded using the
source
command)\&.
.sp
This option was added in MySQL 5\&.6\&.3\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: bind-address option
.\" bind-address option: mysql
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&.
.sp
This option is supported beginning with MySQL 5\&.6\&.1\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: character-sets-dir option
.\" character-sets-dir option: mysql
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
The directory where character sets are installed\&. See
Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: column-names option
.\" column-names option: mysql
\fB\-\-column\-names\fR
.sp
Write column names in results\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: column-type-info option
.\" column-type-info option: mysql
\fB\-\-column\-type\-info\fR,
\fB\-m\fR
.sp
Display result set metadata\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: comments option
.\" comments option: mysql
\fB\-\-comments\fR,
\fB\-c\fR
.sp
Whether to preserve comments in statements sent to the server\&. The default is \-\-skip\-comments (discard comments), enable with \-\-comments (preserve comments)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: compress option
.\" compress option: mysql
\fB\-\-compress\fR,
\fB\-C\fR
.sp
Compress all information sent between the client and the server if both support compression\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: database option
.\" database option: mysql
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-D \fR\fB\fIdb_name\fR\fR
.sp
The database to use\&. This is useful primarily in an option file\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: debug option
.\" debug option: mysql
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
Write a debugging log\&. A typical
\fIdebug_options\fR
string is
\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is
\*(Aqd:t:o,/tmp/mysql\&.trace\*(Aq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: debug-check option
.\" debug-check option: mysql
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: debug-info option
.\" debug-info option: mysql
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: default-auth option
.\" default-auth option: mysql
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
The client\-side authentication plugin to use\&. See
Section\ \&6.3.6, \(lqPluggable Authentication\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: default-character-set option
.\" default-character-set option: mysql
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
\fIcharset_name\fR
as the default character set for the client and connection\&.
.sp
A common issue that can occur when the operating system uses
utf8
or another multi\-byte character set is that output from the
\fBmysql\fR
client is formatted incorrectly, due to the fact that the MySQL client uses the
latin1
character set by default\&. You can usually fix such issues by using this option to force the client to use the system character set instead\&.
.sp
See
Section\ \&10.5, \(lqCharacter Set Configuration\(rq, for more information\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: delimiter option
.\" delimiter option: mysql
\fB\-\-delimiter=\fR\fB\fIstr\fR\fR
.sp
Set the statement delimiter\&. The default is the semicolon character (\(lq;\(rq)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: disable named commands
.\" disable named command: mysql
\fB\-\-disable\-named\-commands\fR
.sp
Disable named commands\&. Use the
\e*
form only, or use named commands only at the beginning of a line ending with a semicolon (\(lq;\(rq)\&.
\fBmysql\fR
starts with this option
\fIenabled\fR
by default\&. However, even with this option, long\-format commands still work from the first line\&. See
the section called \(lqMYSQL COMMANDS\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: enable-cleartext-plugin option
.\" enable-cleartext-plugin option: mysql
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
Section\ \&6.3.6.3, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: execute option
.\" execute option: mysql
\fB\-\-execute=\fR\fB\fIstatement\fR\fR,
\fB\-e \fR\fB\fIstatement\fR\fR
.sp
Execute the statement and quit\&. The default output format is like that produced with
\fB\-\-batch\fR\&. See
Section\ \&4.2.3.1, \(lqUsing Options on the Command Line\(rq, for some examples\&. With this option,
\fBmysql\fR
does not use the history file\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: force option
.\" force option: mysql
\fB\-\-force\fR,
\fB\-f\fR
.sp
Continue even if an SQL error occurs\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: histignore option
.\" histignore option: mysql
\fB\-\-histignore\fR
.sp
A colon\-separated list of one or more patterns specifying statements not to log to the history file\&. For more information, see
the section called \(lqMYSQL HISTORY FILE\(rq\&. This option was added in MySQL 5\&.6\&.8\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: host option
.\" host option: mysql
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
Connect to the MySQL server on the given host\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: html option
.\" html option: mysql
\fB\-\-html\fR,
\fB\-H\fR
.sp
Produce HTML output\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: ignore-spaces option
.\" ignore-spaces option: mysql
\fB\-\-ignore\-spaces\fR,
\fB\-i\fR
.sp
Ignore spaces after function names\&. The effect of this is described in the discussion for the
IGNORE_SPACE
SQL mode (see
Section\ \&5.1.7, \(lqServer SQL Modes\(rq)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: init-command option
.\" init-command option: mysql
\fB\-\-init\-command=str\fR
.sp
SQL statement to execute after connecting to the server\&. If auto\-reconnect is enabled, the statement is executed again after reconnection occurs\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: line-numbers option
.\" line-numbers option: mysql
\fB\-\-line\-numbers\fR
.sp
Write line numbers for errors\&. Disable this with
\fB\-\-skip\-line\-numbers\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: local-infile option
.\" local-infile option: mysql
\fB\-\-local\-infile[={0|1}]\fR
.sp
Enable or disable
LOCAL
capability for
LOAD DATA INFILE\&. With no value, the option enables
LOCAL\&. The option may be given as
\fB\-\-local\-infile=0\fR
or
\fB\-\-local\-infile=1\fR
to explicitly disable or enable
LOCAL\&. Enabling
LOCAL
has no effect if the server does not also support it\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: named-commands option
.\" named-commands option: mysql
\fB\-\-named\-commands\fR,
\fB\-G\fR
.sp
Enable named
\fBmysql\fR
commands\&. Long\-format commands are permitted, not just short\-format commands\&. For example,
quit
and
\eq
both are recognized\&. Use
\fB\-\-skip\-named\-commands\fR
to disable named commands\&. See
the section called \(lqMYSQL COMMANDS\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: no-auto-rehash option
.\" no-auto-rehash option: mysql
\fB\-\-no\-auto\-rehash\fR,
\fB\-A\fR
.sp
This has the same effect as
\fB\-skip\-auto\-rehash\fR\&. See the description for
\fB\-\-auto\-rehash\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: no-beep option
.\" no-beep option: mysql
\fB\-\-no\-beep\fR,
\fB\-b\fR
.sp
Do not beep when errors occur\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: one-database option
.\" one-database option: mysql
\fB\-\-one\-database\fR,
\fB\-o\fR
.sp
Ignore statements except those that occur while the default database is the one named on the command line\&. This option is rudimentary and should be used with care\&. Statement filtering is based only on
USE
statements\&.
.sp
Initially,
\fBmysql\fR
executes statements in the input because specifying a database
\fIdb_name\fR
on the command line is equivalent to inserting
USE \fIdb_name\fR
at the beginning of the input\&. Then, for each
USE
statement encountered,
\fBmysql\fR
accepts or rejects following statements depending on whether the database named is the one on the command line\&. The content of the statements is immaterial\&.
.sp
Suppose that
\fBmysql\fR
is invoked to process this set of statements:
.sp
.if n \{\
.RS 4
.\}
.nf
DELETE FROM db2\&.t2;
USE db2;
DROP TABLE db1\&.t1;
CREATE TABLE db1\&.t1 (i INT);
USE db1;
INSERT INTO t1 (i) VALUES(1);
CREATE TABLE db2\&.t1 (j INT);
.fi
.if n \{\
.RE
.\}
.sp
If the command line is
\fBmysql \-\-force \-\-one\-database db1\fR,
\fBmysql\fR
handles the input as follows:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
DELETE
statement is executed because the default database is
db1, even though the statement names a table in a different database\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
DROP TABLE
and
CREATE TABLE
statements are not executed because the default database is not
db1, even though the statements name a table in
db1\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
INSERT
and
CREATE TABLE
statements are executed because the default database is
db1, even though the
CREATE TABLE
statement names a table in a different database\&.
.RE
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: pager option
.\" pager option: mysql
\fB\-\-pager[=\fR\fB\fIcommand\fR\fR\fB]\fR
.sp
Use the given command for paging query output\&. If the command is omitted, the default pager is the value of your
PAGER
environment variable\&. Valid pagers are
\fBless\fR,
\fBmore\fR,
\fBcat [> filename]\fR, and so forth\&. This option works only on Unix and only in interactive mode\&. To disable paging, use
\fB\-\-skip\-pager\fR\&.
the section called \(lqMYSQL COMMANDS\(rq, discusses output paging further\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: password option
.\" password option: mysql
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
The password to use when connecting to the server\&. If you use the short option form (\fB\-p\fR), you
\fIcannot\fR
have a space between the option and the password\&. If you omit the
\fIpassword\fR
value following the
\fB\-\-password\fR
or
\fB\-p\fR
option on the command line,
\fBmysql\fR
prompts for one\&.
.sp
Specifying a password on the command line should be considered insecure\&. See
Section\ \&6.1.2.1, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: pipe option
.\" pipe option: mysql
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
On Windows, connect to the server using a named pipe\&. This option applies only if the server supports named\-pipe connections\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: plugin-dir option
.\" plugin-dir option: mysql
\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR
.sp
The directory in which to look for plugins\&. It may be necessary to specify this option if the
\fB\-\-default\-auth\fR
option is used to specify an authentication plugin but
\fBmysql\fR
does not find it\&. See
Section\ \&6.3.6, \(lqPluggable Authentication\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: port option
.\" port option: mysql
.\" TCP/IP
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
The TCP/IP port number to use for the connection\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: prompt option
.\" prompt option: mysql
\fB\-\-prompt=\fR\fB\fIformat_str\fR\fR
.sp
Set the prompt to the specified format\&. The default is
mysql>\&. The special sequences that the prompt can contain are described in
the section called \(lqMYSQL COMMANDS\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: protocol option
.\" protocol option: mysql
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: quick option
.\" quick option: mysql
\fB\-\-quick\fR,
\fB\-q\fR
.sp
Do not cache each query result, print each row as it is received\&. This may slow down the server if the output is suspended\&. With this option,
\fBmysql\fR
does not use the history file\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql: raw option
.\" raw option: mysql
\fB\-\-raw\fR,
\fB\-r\fR