~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to man/mysql.1

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
.\"     Title: \fBmysql\fR
3
3
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4
4
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5
 
.\"      Date: 07/06/2010
 
5
.\"      Date: 12/16/2011
6
6
.\"    Manual: MySQL Database System
7
7
.\"    Source: MySQL 5.1
8
8
.\"  Language: English
9
9
.\"
10
 
.TH "\FBMYSQL\FR" "1" "07/06/2010" "MySQL 5\&.1" "MySQL Database System"
 
10
.TH "\FBMYSQL\FR" "1" "12/16/2011" "MySQL 5\&.1" "MySQL Database System"
11
11
.\" -----------------------------------------------------------------
12
12
.\" * set default formatting
13
13
.\" -----------------------------------------------------------------
77
77
\eG
78
78
and press Enter\&.
79
79
.PP
80
 
As of MySQL 5\&.1\&.10, typing Control\-C causes
81
 
\fBmysql\fR
82
 
to attempt to kill the current statement\&. If this cannot be done, or Control\-C is typed again before the statement is killed,
83
 
\fBmysql\fR
84
 
exits\&. Previously, Control\-C caused
 
80
As of MySQL 5\&.1\&.10, typing Control+C causes
 
81
\fBmysql\fR
 
82
to attempt to kill the current statement\&. If this cannot be done, or Control+C is typed again before the statement is killed,
 
83
\fBmysql\fR
 
84
exits\&. Previously, Control+C caused
85
85
\fBmysql\fR
86
86
to exit in all cases\&.
87
87
.PP
96
96
.if n \{\
97
97
.RE
98
98
.\}
 
99
.PP
 
100
On Unix, the
 
101
\fBmysql\fR
 
102
client writes a record of executed statements to a history file\&. See
 
103
the section called \(lqMYSQL HISTORY FILE\(rq\&.
99
104
.SH "MYSQL OPTIONS"
100
105
.\" mysql command options
101
106
.\" command options: mysql
107
112
[mysql]
108
113
and
109
114
[client]
110
 
option file groups\&.
 
115
groups of an option file\&.
111
116
\fBmysql\fR
112
117
also supports the options for processing option files described at
113
118
Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
183
188
.sp -1
184
189
.IP \(bu 2.3
185
190
.\}
 
191
.\" mysql: bind-address option
 
192
.\" bind-address option: mysql
 
193
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
 
194
.sp
 
195
On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&.
 
196
.sp
 
197
This option is supported only in the version of the
 
198
\fBmysql\fR
 
199
client that is supplied with MySQL Cluster, beginning with MySQL Cluster NDB 6\&.3\&.4\&. It is not available in standard MySQL 5\&.1 releases\&.
 
200
.RE
 
201
.sp
 
202
.RS 4
 
203
.ie n \{\
 
204
\h'-04'\(bu\h'+03'\c
 
205
.\}
 
206
.el \{\
 
207
.sp -1
 
208
.IP \(bu 2.3
 
209
.\}
186
210
.\" mysql: character-sets-dir option
187
211
.\" character-sets-dir option: mysql
188
212
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
406
430
.sp
407
431
Execute the statement and quit\&. The default output format is like that produced with
408
432
\fB\-\-batch\fR\&. See
409
 
Section\ \&4.2.3.1, \(lqUsing Options on the Command Line\(rq, for some examples\&.
 
433
Section\ \&4.2.3.1, \(lqUsing Options on the Command Line\(rq, for some examples\&. With this option,
 
434
\fBmysql\fR
 
435
does not use the history file\&.
410
436
.RE
411
437
.sp
412
438
.RS 4
473
499
Ignore spaces after function names\&. The effect of this is described in the discussion for the
474
500
IGNORE_SPACE
475
501
SQL mode (see
476
 
Section\ \&5.1.7, \(lqServer SQL Modes\(rq)\&.
 
502
Section\ \&5.1.6, \(lqServer SQL Modes\(rq)\&.
477
503
.RE
478
504
.sp
479
505
.RS 4
533
559
.sp
534
560
Enable named
535
561
\fBmysql\fR
536
 
commands\&. Long\-format commands are allowed, not just short\-format commands\&. For example,
 
562
commands\&. Long\-format commands are permitted, not just short\-format commands\&. For example,
537
563
quit
538
564
and
539
565
\eq
650
676
\fB\-\-one\-database\fR,
651
677
\fB\-o\fR
652
678
.sp
653
 
Ignore statements except those for the default database named on the command line\&. This is useful for skipping updates to other databases in the binary log\&.
 
679
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
 
680
USE
 
681
statements\&.
 
682
.sp
 
683
Initially,
 
684
\fBmysql\fR
 
685
executes statements in the input because specifying a database
 
686
\fIdb_name\fR
 
687
on the command line is equivalent to inserting
 
688
USE \fIdb_name\fR
 
689
at the beginning of the input\&. Then, for each
 
690
USE
 
691
statement encountered,
 
692
\fBmysql\fR
 
693
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\&.
 
694
.sp
 
695
Suppose that
 
696
\fBmysql\fR
 
697
is invoked to process this set of statements:
 
698
.sp
 
699
.if n \{\
 
700
.RS 4
 
701
.\}
 
702
.nf
 
703
DELETE FROM db2\&.t2;
 
704
USE db2;
 
705
DROP TABLE db1\&.t1;
 
706
CREATE TABLE db1\&.t1 (i INT);
 
707
USE db1;
 
708
INSERT INTO t1 (i) VALUES(1);
 
709
CREATE TABLE db2\&.t1 (j INT);
 
710
.fi
 
711
.if n \{\
 
712
.RE
 
713
.\}
 
714
.sp
 
715
If the command line is
 
716
\fBmysql \-\-force \-\-one\-database db1\fR,
 
717
\fBmysql\fR
 
718
handles the input as follows:
 
719
.sp
 
720
.RS 4
 
721
.ie n \{\
 
722
\h'-04'\(bu\h'+03'\c
 
723
.\}
 
724
.el \{\
 
725
.sp -1
 
726
.IP \(bu 2.3
 
727
.\}
 
728
The
 
729
DELETE
 
730
statement is executed because the default database is
 
731
db1, even though the statement names a table in a different database\&.
 
732
.RE
 
733
.sp
 
734
.RS 4
 
735
.ie n \{\
 
736
\h'-04'\(bu\h'+03'\c
 
737
.\}
 
738
.el \{\
 
739
.sp -1
 
740
.IP \(bu 2.3
 
741
.\}
 
742
The
 
743
DROP TABLE
 
744
and
 
745
CREATE TABLE
 
746
statements are not executed because the default database is not
 
747
db1, even though the statements name a table in
 
748
db1\&.
 
749
.RE
 
750
.sp
 
751
.RS 4
 
752
.ie n \{\
 
753
\h'-04'\(bu\h'+03'\c
 
754
.\}
 
755
.el \{\
 
756
.sp -1
 
757
.IP \(bu 2.3
 
758
.\}
 
759
The
 
760
INSERT
 
761
and
 
762
CREATE TABLE
 
763
statements are executed because the default database is
 
764
db1, even though the
 
765
CREATE TABLE
 
766
statement names a table in a different database\&.
 
767
.RE
654
768
.RE
655
769
.sp
656
770
.RS 4
717
831
\fB\-\-pipe\fR,
718
832
\fB\-W\fR
719
833
.sp
720
 
On Windows, connect to the server via a named pipe\&. This option applies only if the server supports named\-pipe connections\&.
 
834
On Windows, connect to the server using a named pipe\&. This option applies only if the server supports named\-pipe connections\&.
721
835
.RE
722
836
.sp
723
837
.RS 4
765
879
.\" protocol option: mysql
766
880
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
767
881
.sp
768
 
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 allowable values, see
 
882
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
769
883
Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
770
884
.RE
771
885
.sp
874
988
\fB\-\-i\-am\-a\-dummy\fR,
875
989
\fB\-U\fR
876
990
.sp
877
 
Allow only those
 
991
Permit only those
878
992
UPDATE
879
993
and
880
994
DELETE
928
1042
.sp
929
1043
Ignore
930
1044
SIGINT
931
 
signals (typically the result of typing Control\-C)\&.
 
1045
signals (typically the result of typing Control+C)\&.
932
1046
.RE
933
1047
.sp
934
1048
.RS 4
1014
1128
.sp
1015
1129
Options that begin with
1016
1130
\fB\-\-ssl\fR
1017
 
specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See
 
1131
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
1018
1132
Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
1019
1133
.RE
1020
1134
.sp
1232
1346
.RE
1233
1347
.\}
1234
1348
.sp
1235
 
(See
1236
 
\m[blue]\fBBug#25946\fR\m[]\&\s-2\u[1]\d\s+2\&.)
 
1349
(See Bug #25946\&.)
1237
1350
.RE
1238
1351
.PP
1239
1352
You can also set the following variables by using
1316
1429
statements when using
1317
1430
\fB\-\-safe\-updates\fR\&. (Default value is 1,000\&.)
1318
1431
.RE
1319
 
.\" MYSQL_HISTFILE environment variable
1320
 
.\" environment variable: MYSQL_HISTFILE
1321
 
.\" HOME environment variable
1322
 
.\" environment variable: HOME
1323
 
.\" mysql history file
1324
 
.\" command-line history: mysql
1325
 
.\" .mysql_history file
1326
 
.PP
1327
 
On Unix, the
1328
 
\fBmysql\fR
1329
 
client writes a record of executed statements to a history file\&. By default, this file is named
1330
 
\&.mysql_history
1331
 
and is created in your home directory\&. To specify a different file, set the value of the
1332
 
MYSQL_HISTFILE
1333
 
environment variable\&.
1334
 
.PP
1335
 
The
1336
 
\&.mysql_history
1337
 
should be protected with a restrictive access mode because sensitive information might be written to it, such as the text of SQL statements that contain passwords\&. See
1338
 
Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&.
1339
 
.PP
1340
 
If you do not want to maintain a history file, first remove
1341
 
\&.mysql_history
1342
 
if it exists, and then use either of the following techniques:
1343
 
.sp
1344
 
.RS 4
1345
 
.ie n \{\
1346
 
\h'-04'\(bu\h'+03'\c
1347
 
.\}
1348
 
.el \{\
1349
 
.sp -1
1350
 
.IP \(bu 2.3
1351
 
.\}
1352
 
Set the
1353
 
MYSQL_HISTFILE
1354
 
variable to
1355
 
/dev/null\&. To cause this setting to take effect each time you log in, put the setting in one of your shell\'s startup files\&.
1356
 
.RE
1357
 
.sp
1358
 
.RS 4
1359
 
.ie n \{\
1360
 
\h'-04'\(bu\h'+03'\c
1361
 
.\}
1362
 
.el \{\
1363
 
.sp -1
1364
 
.IP \(bu 2.3
1365
 
.\}
1366
 
Create
1367
 
\&.mysql_history
1368
 
as a symbolic link to
1369
 
/dev/null:
1370
 
.sp
1371
 
.if n \{\
1372
 
.RS 4
1373
 
.\}
1374
 
.nf
1375
 
shell> \fBln \-s /dev/null $HOME/\&.mysql_history\fR
1376
 
.fi
1377
 
.if n \{\
1378
 
.RE
1379
 
.\}
1380
 
.sp
1381
 
You need do this only once\&.
1382
 
.RE
1383
1432
.SH "MYSQL COMMANDS"
1384
1433
.PP
1385
1434
\fBmysql\fR
1449
1498
.\}
1450
1499
.\" mysql: help command
1451
1500
.\" help command: mysql
1452
 
\fBhelp [\fR\fB\fIarg\fR\fR\fB]\fR,
1453
 
\fB\eh [\fR\fB\fIarg\fR\fR\fB]\fR,
1454
 
\fB\e? [\fR\fB\fIarg\fR\fR\fB]\fR,
1455
 
\fB? [\fR\fB\fIarg\fR\fR\fB]\fR
 
1501
help [\fIarg\fR],
 
1502
\eh [\fIarg\fR],
 
1503
\e? [\fIarg\fR],
 
1504
? [\fIarg\fR]
1456
1505
.sp
1457
1506
Display a help message listing the available
1458
1507
\fBmysql\fR
1476
1525
.\}
1477
1526
.\" mysql: charset command
1478
1527
.\" charset command: mysql
1479
 
\fBcharset \fR\fB\fIcharset_name\fR\fR,
1480
 
\fB\eC \fR\fB\fIcharset_name\fR\fR
 
1528
charset \fIcharset_name\fR,
 
1529
\eC \fIcharset_name\fR
1481
1530
.sp
1482
1531
Change the default character set and issue a
1483
1532
SET NAMES
1496
1545
.\}
1497
1546
.\" mysql: clear command
1498
1547
.\" clear command: mysql
1499
 
\fBclear\fR,
1500
 
\fB\ec\fR
 
1548
clear,
 
1549
\ec
1501
1550
.sp
1502
1551
Clear the current input\&. Use this if you change your mind about executing the statement that you are entering\&.
1503
1552
.RE
1512
1561
.\}
1513
1562
.\" mysql: connect command
1514
1563
.\" connect command: mysql
1515
 
\fBconnect [\fR\fB\fIdb_name\fR\fR\fB \fR\fB\fIhost_name\fR\fR\fB]]\fR,
1516
 
\fB\er [\fR\fB\fIdb_name\fR\fR\fB \fR\fB\fIhost_name\fR\fR\fB]]\fR
 
1564
connect [\fIdb_name\fR \fIhost_name\fR]],
 
1565
\er [\fIdb_name\fR \fIhost_name\fR]]
1517
1566
.sp
1518
1567
Reconnect to the server\&. The optional database name and host name arguments may be given to specify the default database or the host where the server is running\&. If omitted, the current values are used\&.
1519
1568
.RE
1528
1577
.\}
1529
1578
.\" mysql: delimiter command
1530
1579
.\" delimiter command: mysql
1531
 
\fBdelimiter \fR\fB\fIstr\fR\fR,
1532
 
\fB\ed \fR\fB\fIstr\fR\fR
 
1580
delimiter \fIstr\fR,
 
1581
\ed \fIstr\fR
1533
1582
.sp
1534
1583
Change the string that
1535
1584
\fBmysql\fR
1536
1585
interprets as the separator between SQL statements\&. The default is the semicolon character (\(lq;\(rq)\&.
1537
1586
.sp
1538
 
The delimiter can be specified as an unquoted or quoted argument\&. Quoting can be done with either single quote (\') or douple quote (") characters\&. To include a quote within a quoted string, either quote the string with the other quote character or escape the quote with a backslash (\(lq\e\(rq) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MySQL\&. For an unquoted argument, the delmiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&.
 
1587
The delimiter string can be specified as an unquoted or quoted argument on the
 
1588
delimiter
 
1589
command line\&. Quoting can be done with either single quote (\'), douple quote ("), or backtick (`) characters\&. To include a quote within a quoted string, either quote the string with a different quote character or escape the quote with a backslash (\(lq\e\(rq) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MySQL\&. For an unquoted argument, the delimiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&.
 
1590
.sp
 
1591
\fBmysql\fR
 
1592
interprets instances of the delimiter string as a statement delimiter anywhere it occurs, except within quoted strings\&. Be careful about defining a delimiter that might occur within other words\&. For example, if you define the delimiter as
 
1593
X, you will be unable to use the word
 
1594
INDEX
 
1595
in statements\&.
 
1596
\fBmysql\fR
 
1597
interprets this as
 
1598
INDE
 
1599
followed by the delimiter
 
1600
X\&.
1539
1601
.sp
1540
1602
When the delimiter recognized by
1541
1603
\fBmysql\fR
1543
1605
\(lq;\(rq, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets
1544
1606
\(lq;\(rq
1545
1607
as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution (see
1546
 
Section\ \&21.9.12, \(lqC API Support for Multiple Statement Execution\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see
1547
 
Section\ \&19.1, \(lqDefining Stored Programs\(rq)\&.
 
1608
Section\ \&20.9.12, \(lqC API Support for Multiple Statement Execution\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see
 
1609
Section\ \&18.1, \(lqDefining Stored Programs\(rq)\&.
1548
1610
.RE
1549
1611
.sp
1550
1612
.RS 4
1557
1619
.\}
1558
1620
.\" mysql: edit command
1559
1621
.\" edit command: mysql
1560
 
\fBedit\fR,
1561
 
\fB\ee\fR
 
1622
edit,
 
1623
\ee
1562
1624
.sp
1563
1625
Edit the current input statement\&.
1564
1626
\fBmysql\fR
1571
1633
if neither variable is set\&.
1572
1634
.sp
1573
1635
The
1574
 
\fBedit\fR
 
1636
edit
1575
1637
command works only in Unix\&.
1576
1638
.RE
1577
1639
.sp
1585
1647
.\}
1586
1648
.\" mysql: ego command
1587
1649
.\" ego command: mysql
1588
 
\fBego\fR,
1589
 
\fB\eG\fR
 
1650
ego,
 
1651
\eG
1590
1652
.sp
1591
1653
Send the current statement to the server to be executed and display the result using vertical format\&.
1592
1654
.RE
1601
1663
.\}
1602
1664
.\" mysql: exit command
1603
1665
.\" exit command: mysql
1604
 
\fBexit\fR,
1605
 
\fB\eq\fR
 
1666
exit,
 
1667
\eq
1606
1668
.sp
1607
1669
Exit
1608
1670
\fBmysql\fR\&.
1618
1680
.\}
1619
1681
.\" mysql: go command
1620
1682
.\" go command: mysql
1621
 
\fBgo\fR,
1622
 
\fB\eg\fR
 
1683
go,
 
1684
\eg
1623
1685
.sp
1624
1686
Send the current statement to the server to be executed\&.
1625
1687
.RE
1634
1696
.\}
1635
1697
.\" mysql: nopager command
1636
1698
.\" nopager command: mysql
1637
 
\fBnopager\fR,
1638
 
\fB\en\fR
 
1699
nopager,
 
1700
\en
1639
1701
.sp
1640
1702
Disable output paging\&. See the description for
1641
 
\fBpager\fR\&.
 
1703
pager\&.
1642
1704
.sp
1643
1705
The
1644
 
\fBnopager\fR
 
1706
nopager
1645
1707
command works only in Unix\&.
1646
1708
.RE
1647
1709
.sp
1655
1717
.\}
1656
1718
.\" mysql: notee command
1657
1719
.\" notee command: mysql
1658
 
\fBnotee\fR,
1659
 
\fB\et\fR
 
1720
notee,
 
1721
\et
1660
1722
.sp
1661
1723
Disable output copying to the tee file\&. See the description for
1662
 
\fBtee\fR\&.
 
1724
tee\&.
1663
1725
.RE
1664
1726
.sp
1665
1727
.RS 4
1672
1734
.\}
1673
1735
.\" mysql: nowarning command
1674
1736
.\" nowarning command: mysql
1675
 
\fBnowarning\fR,
1676
 
\fB\ew\fR
 
1737
nowarning,
 
1738
\ew
1677
1739
.sp
1678
1740
Enable display of warnings after each statement\&.
1679
1741
.RE
1688
1750
.\}
1689
1751
.\" mysql: pager command
1690
1752
.\" pager command: mysql
1691
 
\fBpager [\fR\fB\fIcommand\fR\fR\fB]\fR,
1692
 
\fB\eP [\fR\fB\fIcommand\fR\fR\fB]\fR
 
1753
pager [\fIcommand\fR],
 
1754
\eP [\fIcommand\fR]
1693
1755
.sp
1694
1756
Enable output paging\&. By using the
1695
1757
\fB\-\-pager\fR
1703
1765
environment variable and sets the pager to that\&. Pager functionality works only in interactive mode\&.
1704
1766
.sp
1705
1767
Output paging can be enabled interactively with the
1706
 
\fBpager\fR
 
1768
pager
1707
1769
command and disabled with
1708
 
\fBnopager\fR\&. The command takes an optional argument; if given, the paging program is set to that\&. With no argument, the pager is set to the pager that was set on the command line, or
 
1770
nopager\&. The command takes an optional argument; if given, the paging program is set to that\&. With no argument, the pager is set to the pager that was set on the command line, or
1709
1771
stdout
1710
1772
if no pager was specified\&.
1711
1773
.sp
1712
1774
Output paging works only in Unix because it uses the
1713
1775
popen()
1714
1776
function, which does not exist on Windows\&. For Windows, the
1715
 
\fBtee\fR
 
1777
tee
1716
1778
option can be used instead to save query output, although it is not as convenient as
1717
 
\fBpager\fR
 
1779
pager
1718
1780
for browsing output in some situations\&.
1719
1781
.RE
1720
1782
.sp
1728
1790
.\}
1729
1791
.\" mysql: print command
1730
1792
.\" print command: mysql
1731
 
\fBprint\fR,
1732
 
\fB\ep\fR
 
1793
print,
 
1794
\ep
1733
1795
.sp
1734
1796
Print the current input statement without executing it\&.
1735
1797
.RE
1744
1806
.\}
1745
1807
.\" mysql: prompt command
1746
1808
.\" prompt command: mysql
1747
 
\fBprompt [\fR\fB\fIstr\fR\fR\fB]\fR,
1748
 
\fB\eR [\fR\fB\fIstr\fR\fR\fB]\fR
 
1809
prompt [\fIstr\fR],
 
1810
\eR [\fIstr\fR]
1749
1811
.sp
1750
1812
Reconfigure the
1751
1813
\fBmysql\fR
1769
1831
.\}
1770
1832
.\" mysql: quit command
1771
1833
.\" quit command: mysql
1772
 
\fBquit\fR,
1773
 
\fB\eq\fR
 
1834
quit,
 
1835
\eq
1774
1836
.sp
1775
1837
Exit
1776
1838
\fBmysql\fR\&.
1786
1848
.\}
1787
1849
.\" mysql: rehash command
1788
1850
.\" rehash command: mysql
1789
 
\fBrehash\fR,
1790
 
\fB\e#\fR
 
1851
rehash,
 
1852
\e#
1791
1853
.sp
1792
1854
Rebuild the completion hash that enables database, table, and column name completion while you are entering statements\&. (See the description for the
1793
1855
\fB\-\-auto\-rehash\fR
1804
1866
.\}
1805
1867
.\" mysql: source command
1806
1868
.\" source command: mysql
1807
 
\fBsource \fR\fB\fIfile_name\fR\fR,
1808
 
\fB\e\&. \fR\fB\fIfile_name\fR\fR
 
1869
source \fIfile_name\fR,
 
1870
\e\&. \fIfile_name\fR
1809
1871
.sp
1810
1872
Read the named file and executes the statements contained therein\&. On Windows, you can specify path name separators as
1811
1873
/
1823
1885
.\}
1824
1886
.\" mysql: status command
1825
1887
.\" status command: mysql
1826
 
\fBstatus\fR,
1827
 
\fB\es\fR
 
1888
status,
 
1889
\es
1828
1890
.sp
1829
1891
Provide status information about the connection and the server you are using\&. If you are running in
1830
1892
\fB\-\-safe\-updates\fR
1845
1907
.\}
1846
1908
.\" mysql: system command
1847
1909
.\" system command: mysql
1848
 
\fBsystem \fR\fB\fIcommand\fR\fR,
1849
 
\fB\e! \fR\fB\fIcommand\fR\fR
 
1910
system \fIcommand\fR,
 
1911
\e! \fIcommand\fR
1850
1912
.sp
1851
1913
Execute the given command using your default command interpreter\&.
1852
1914
.sp
1853
1915
The
1854
 
\fBsystem\fR
 
1916
system
1855
1917
command works only in Unix\&.
1856
1918
.RE
1857
1919
.sp
1865
1927
.\}
1866
1928
.\" mysql: tee command
1867
1929
.\" tee command: mysql
1868
 
\fBtee [\fR\fB\fIfile_name\fR\fR\fB]\fR,
1869
 
\fB\eT [\fR\fB\fIfile_name\fR\fR\fB]\fR
 
1930
tee [\fIfile_name\fR],
 
1931
\eT [\fIfile_name\fR]
1870
1932
.sp
1871
1933
By using the
1872
1934
\fB\-\-tee\fR
1876
1938
flushes results to the file after each statement, just before it prints its next prompt\&. Tee functionality works only in interactive mode\&.
1877
1939
.sp
1878
1940
You can enable this feature interactively with the
1879
 
\fBtee\fR
 
1941
tee
1880
1942
command\&. Without a parameter, the previous file is used\&. The
1881
 
\fBtee\fR
 
1943
tee
1882
1944
file can be disabled with the
1883
 
\fBnotee\fR
 
1945
notee
1884
1946
command\&. Executing
1885
 
\fBtee\fR
 
1947
tee
1886
1948
again re\-enables logging\&.
1887
1949
.RE
1888
1950
.sp
1896
1958
.\}
1897
1959
.\" mysql: use command
1898
1960
.\" use command: mysql
1899
 
\fBuse \fR\fB\fIdb_name\fR\fR,
1900
 
\fB\eu \fR\fB\fIdb_name\fR\fR
 
1961
use \fIdb_name\fR,
 
1962
\eu \fIdb_name\fR
1901
1963
.sp
1902
1964
Use
1903
1965
\fIdb_name\fR
1914
1976
.\}
1915
1977
.\" mysql: warnings command
1916
1978
.\" warnings command: mysql
1917
 
\fBwarnings\fR,
1918
 
\fB\eW\fR
 
1979
warnings,
 
1980
\eW
1919
1981
.sp
1920
1982
Enable display of warnings after each statement (if there are any)\&.
1921
1983
.RE
1922
1984
.PP
1923
1985
Here are a few tips about the
1924
 
\fBpager\fR
 
1986
pager
1925
1987
command:
1926
1988
.sp
1927
1989
.RS 4
2041
2103
In this example, the command would send query results to two files in two different directories on two different file systems mounted on
2042
2104
/dr1
2043
2105
and
2044
 
/dr2, yet still display the results onscreen via
 
2106
/dr2, yet still display the results onscreen using
2045
2107
\fBless\fR\&.
2046
2108
.RE
2047
2109
.PP
2048
2110
You can also combine the
2049
 
\fBtee\fR
 
2111
tee
2050
2112
and
2051
 
\fBpager\fR
 
2113
pager
2052
2114
functions\&. Have a
2053
 
\fBtee\fR
 
2115
tee
2054
2116
file enabled and
2055
 
\fBpager\fR
 
2117
pager
2056
2118
set to
2057
2119
\fBless\fR, and you are able to browse the results using the
2058
2120
\fBless\fR
2059
2121
program and still have everything appended into a file the same time\&. The difference between the Unix
2060
 
\fBtee\fR
 
2122
tee
2061
2123
used with the
2062
 
\fBpager\fR
 
2124
pager
2063
2125
command and the
2064
2126
\fBmysql\fR
2065
2127
built\-in
2066
 
\fBtee\fR
 
2128
tee
2067
2129
command is that the built\-in
2068
 
\fBtee\fR
 
2130
tee
2069
2131
works even if you do not have the Unix
2070
2132
\fBtee\fR
2071
2133
available\&. The built\-in
2072
 
\fBtee\fR
 
2134
tee
2073
2135
also logs everything that is printed on the screen, whereas the Unix
2074
2136
\fBtee\fR
2075
2137
used with
2076
 
\fBpager\fR
 
2138
pager
2077
2139
does not log quite that much\&. Additionally,
2078
 
\fBtee\fR
 
2140
tee
2079
2141
file logging can be turned on and off interactively from within
2080
2142
\fBmysql\fR\&. This is useful when you want to log some queries to a file, but not others\&.
2081
2143
.\" mysql prompt command
2082
2144
.PP
2083
2145
The
2084
 
\fBprompt\fR
 
2146
prompt
2085
2147
command reconfigures the default
2086
2148
mysql>
2087
2149
prompt\&. The string for defining the prompt can contain the following special sequences\&.
2088
2150
.TS
2089
2151
allbox tab(:);
2090
 
l l
 
2152
lB lB.
 
2153
T{
 
2154
Option
 
2155
T}:T{
 
2156
Description
 
2157
T}
 
2158
.T&
2091
2159
l l
2092
2160
l l
2093
2161
l l
2117
2185
l l
2118
2186
l l.
2119
2187
T{
2120
 
\fBOption\fR
2121
 
T}:T{
2122
 
\fBDescription\fR
2123
 
T}
2124
 
T{
2125
2188
\ec
2126
2189
T}:T{
2127
2190
A counter that increments for each statement you issue
2354
2417
.sp
2355
2418
In this example, note that the backslashes are doubled\&. If you set the prompt using the
2356
2419
prompt
2357
 
option in an option file, it is advisable to double the backslashes when using the special prompt options\&. There is some overlap in the set of allowable prompt options and the set of special escape sequences that are recognized in option files\&. (The rules for escape sequences in option files are listed in
 
2420
option in an option file, it is advisable to double the backslashes when using the special prompt options\&. There is some overlap in the set of permissible prompt options and the set of special escape sequences that are recognized in option files\&. (The rules for escape sequences in option files are listed in
2358
2421
Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.) The overlap may cause you problems if you use single backslashes\&. For example,
2359
2422
\es
2360
2423
is interpreted as a space rather than as the current seconds value\&. The following example shows how to define a prompt within an option file to include the current time in
2402
2465
.RE
2403
2466
.\}
2404
2467
.RE
 
2468
.SH "MYSQL HISTORY FILE"
 
2469
.\" MYSQL_HISTFILE environment variable
 
2470
.\" environment variable: MYSQL_HISTFILE
 
2471
.\" HOME environment variable
 
2472
.\" environment variable: HOME
 
2473
.\" mysql history file
 
2474
.\" command-line history: mysql
 
2475
.\" .mysql_history file
 
2476
.PP
 
2477
On Unix, the
 
2478
\fBmysql\fR
 
2479
client writes a record of executed statements to a history file\&. By default, this file is named
 
2480
\&.mysql_history
 
2481
and is created in your home directory\&. To specify a different file, set the value of the
 
2482
MYSQL_HISTFILE
 
2483
environment variable\&.
 
2484
.PP
 
2485
The
 
2486
\&.mysql_history
 
2487
should be protected with a restrictive access mode because sensitive information might be written to it, such as the text of SQL statements that contain passwords\&. See
 
2488
Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&.
 
2489
.PP
 
2490
It is possible to suppress logging of statements to the history file by using the
 
2491
\fB\-\-batch\fR
 
2492
or
 
2493
\fB\-\-execute\fR
 
2494
option\&.
 
2495
.PP
 
2496
If you do not want to maintain a history file, first remove
 
2497
\&.mysql_history
 
2498
if it exists, and then use either of the following techniques:
 
2499
.sp
 
2500
.RS 4
 
2501
.ie n \{\
 
2502
\h'-04'\(bu\h'+03'\c
 
2503
.\}
 
2504
.el \{\
 
2505
.sp -1
 
2506
.IP \(bu 2.3
 
2507
.\}
 
2508
Set the
 
2509
MYSQL_HISTFILE
 
2510
variable to
 
2511
/dev/null\&. To cause this setting to take effect each time you log in, put the setting in one of your shell\'s startup files\&.
 
2512
.RE
 
2513
.sp
 
2514
.RS 4
 
2515
.ie n \{\
 
2516
\h'-04'\(bu\h'+03'\c
 
2517
.\}
 
2518
.el \{\
 
2519
.sp -1
 
2520
.IP \(bu 2.3
 
2521
.\}
 
2522
Create
 
2523
\&.mysql_history
 
2524
as a symbolic link to
 
2525
/dev/null:
 
2526
.sp
 
2527
.if n \{\
 
2528
.RS 4
 
2529
.\}
 
2530
.nf
 
2531
shell> \fBln \-s /dev/null $HOME/\&.mysql_history\fR
 
2532
.fi
 
2533
.if n \{\
 
2534
.RE
 
2535
.\}
 
2536
.sp
 
2537
You need do this only once\&.
 
2538
.RE
2405
2539
.SH "MYSQL SERVER-SIDE HELP"
2406
2540
.sp
2407
2541
.if n \{\
2689
2823
.\}
2690
2824
.PP
2691
2825
See
2692
 
Section\ \&5.1.4, \(lqServer System Variables\(rq\&.
 
2826
Section\ \&5.1.3, \(lqServer System Variables\(rq\&.
2693
2827
.PP
2694
2828
The
2695
2829
SET
2703
2837
.sp -1
2704
2838
.IP \(bu 2.3
2705
2839
.\}
2706
 
You are not allowed to execute an
 
2840
You are not permitted to execute an
2707
2841
UPDATE
2708
2842
or
2709
2843
DELETE
2811
2945
option\&.
2812
2946
.PP
2813
2947
For more information about auto\-reconnect and its effect on state information when a reconnection occurs, see
2814
 
Section\ \&21.9.11, \(lqControlling Automatic Reconnection Behavior\(rq\&.
 
2948
Section\ \&20.9.11, \(lqControlling Automatic Reconnection Behavior\(rq\&.
2815
2949
.SH "COPYRIGHT"
2816
2950
.br
2817
2951
.PP
2818
 
Copyright \(co 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 
2952
Copyright \(co 1997, 2011, Oracle and/or its affiliates. All rights reserved.
2819
2953
.PP
2820
2954
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
2821
2955
.PP
2823
2957
.PP
2824
2958
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
2825
2959
.sp
2826
 
.SH "NOTES"
2827
 
.IP " 1." 4
2828
 
Bug#25946
2829
 
.RS 4
2830
 
\%http://bugs.mysql.com/bug.php?id=25946
2831
 
.RE
2832
2960
.SH "SEE ALSO"
2833
2961
For more information, please refer to the MySQL Reference Manual,
2834
2962
which may already be installed locally and which is also available