~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-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 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

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: 11/29/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" "11/29/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
112
112
[mysql]
113
113
and
114
114
[client]
115
 
option file groups\&.
 
115
groups of an option file\&.
116
116
\fBmysql\fR
117
117
also supports the options for processing option files described at
118
118
Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
499
499
Ignore spaces after function names\&. The effect of this is described in the discussion for the
500
500
IGNORE_SPACE
501
501
SQL mode (see
502
 
Section\ \&5.1.7, \(lqServer SQL Modes\(rq)\&.
 
502
Section\ \&5.1.6, \(lqServer SQL Modes\(rq)\&.
503
503
.RE
504
504
.sp
505
505
.RS 4
1042
1042
.sp
1043
1043
Ignore
1044
1044
SIGINT
1045
 
signals (typically the result of typing Control\-C)\&.
 
1045
signals (typically the result of typing Control+C)\&.
1046
1046
.RE
1047
1047
.sp
1048
1048
.RS 4
1346
1346
.RE
1347
1347
.\}
1348
1348
.sp
1349
 
(See
1350
 
\m[blue]\fBBug#25946\fR\m[]\&\s-2\u[1]\d\s+2\&.)
 
1349
(See Bug #25946\&.)
1351
1350
.RE
1352
1351
.PP
1353
1352
You can also set the following variables by using
1499
1498
.\}
1500
1499
.\" mysql: help command
1501
1500
.\" help command: mysql
1502
 
\fBhelp [\fR\fB\fIarg\fR\fR\fB]\fR,
1503
 
\fB\eh [\fR\fB\fIarg\fR\fR\fB]\fR,
1504
 
\fB\e? [\fR\fB\fIarg\fR\fR\fB]\fR,
1505
 
\fB? [\fR\fB\fIarg\fR\fR\fB]\fR
 
1501
help [\fIarg\fR],
 
1502
\eh [\fIarg\fR],
 
1503
\e? [\fIarg\fR],
 
1504
? [\fIarg\fR]
1506
1505
.sp
1507
1506
Display a help message listing the available
1508
1507
\fBmysql\fR
1526
1525
.\}
1527
1526
.\" mysql: charset command
1528
1527
.\" charset command: mysql
1529
 
\fBcharset \fR\fB\fIcharset_name\fR\fR,
1530
 
\fB\eC \fR\fB\fIcharset_name\fR\fR
 
1528
charset \fIcharset_name\fR,
 
1529
\eC \fIcharset_name\fR
1531
1530
.sp
1532
1531
Change the default character set and issue a
1533
1532
SET NAMES
1546
1545
.\}
1547
1546
.\" mysql: clear command
1548
1547
.\" clear command: mysql
1549
 
\fBclear\fR,
1550
 
\fB\ec\fR
 
1548
clear,
 
1549
\ec
1551
1550
.sp
1552
1551
Clear the current input\&. Use this if you change your mind about executing the statement that you are entering\&.
1553
1552
.RE
1562
1561
.\}
1563
1562
.\" mysql: connect command
1564
1563
.\" connect command: mysql
1565
 
\fBconnect [\fR\fB\fIdb_name\fR\fR\fB \fR\fB\fIhost_name\fR\fR\fB]]\fR,
1566
 
\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]]
1567
1566
.sp
1568
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\&.
1569
1568
.RE
1578
1577
.\}
1579
1578
.\" mysql: delimiter command
1580
1579
.\" delimiter command: mysql
1581
 
\fBdelimiter \fR\fB\fIstr\fR\fR,
1582
 
\fB\ed \fR\fB\fIstr\fR\fR
 
1580
delimiter \fIstr\fR,
 
1581
\ed \fIstr\fR
1583
1582
.sp
1584
1583
Change the string that
1585
1584
\fBmysql\fR
1586
1585
interprets as the separator between SQL statements\&. The default is the semicolon character (\(lq;\(rq)\&.
1587
1586
.sp
1588
 
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\&.
1589
1601
.sp
1590
1602
When the delimiter recognized by
1591
1603
\fBmysql\fR
1593
1605
\(lq;\(rq, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets
1594
1606
\(lq;\(rq
1595
1607
as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution (see
1596
 
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
1597
 
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)\&.
1598
1610
.RE
1599
1611
.sp
1600
1612
.RS 4
1607
1619
.\}
1608
1620
.\" mysql: edit command
1609
1621
.\" edit command: mysql
1610
 
\fBedit\fR,
1611
 
\fB\ee\fR
 
1622
edit,
 
1623
\ee
1612
1624
.sp
1613
1625
Edit the current input statement\&.
1614
1626
\fBmysql\fR
1621
1633
if neither variable is set\&.
1622
1634
.sp
1623
1635
The
1624
 
\fBedit\fR
 
1636
edit
1625
1637
command works only in Unix\&.
1626
1638
.RE
1627
1639
.sp
1635
1647
.\}
1636
1648
.\" mysql: ego command
1637
1649
.\" ego command: mysql
1638
 
\fBego\fR,
1639
 
\fB\eG\fR
 
1650
ego,
 
1651
\eG
1640
1652
.sp
1641
1653
Send the current statement to the server to be executed and display the result using vertical format\&.
1642
1654
.RE
1651
1663
.\}
1652
1664
.\" mysql: exit command
1653
1665
.\" exit command: mysql
1654
 
\fBexit\fR,
1655
 
\fB\eq\fR
 
1666
exit,
 
1667
\eq
1656
1668
.sp
1657
1669
Exit
1658
1670
\fBmysql\fR\&.
1668
1680
.\}
1669
1681
.\" mysql: go command
1670
1682
.\" go command: mysql
1671
 
\fBgo\fR,
1672
 
\fB\eg\fR
 
1683
go,
 
1684
\eg
1673
1685
.sp
1674
1686
Send the current statement to the server to be executed\&.
1675
1687
.RE
1684
1696
.\}
1685
1697
.\" mysql: nopager command
1686
1698
.\" nopager command: mysql
1687
 
\fBnopager\fR,
1688
 
\fB\en\fR
 
1699
nopager,
 
1700
\en
1689
1701
.sp
1690
1702
Disable output paging\&. See the description for
1691
 
\fBpager\fR\&.
 
1703
pager\&.
1692
1704
.sp
1693
1705
The
1694
 
\fBnopager\fR
 
1706
nopager
1695
1707
command works only in Unix\&.
1696
1708
.RE
1697
1709
.sp
1705
1717
.\}
1706
1718
.\" mysql: notee command
1707
1719
.\" notee command: mysql
1708
 
\fBnotee\fR,
1709
 
\fB\et\fR
 
1720
notee,
 
1721
\et
1710
1722
.sp
1711
1723
Disable output copying to the tee file\&. See the description for
1712
 
\fBtee\fR\&.
 
1724
tee\&.
1713
1725
.RE
1714
1726
.sp
1715
1727
.RS 4
1722
1734
.\}
1723
1735
.\" mysql: nowarning command
1724
1736
.\" nowarning command: mysql
1725
 
\fBnowarning\fR,
1726
 
\fB\ew\fR
 
1737
nowarning,
 
1738
\ew
1727
1739
.sp
1728
1740
Enable display of warnings after each statement\&.
1729
1741
.RE
1738
1750
.\}
1739
1751
.\" mysql: pager command
1740
1752
.\" pager command: mysql
1741
 
\fBpager [\fR\fB\fIcommand\fR\fR\fB]\fR,
1742
 
\fB\eP [\fR\fB\fIcommand\fR\fR\fB]\fR
 
1753
pager [\fIcommand\fR],
 
1754
\eP [\fIcommand\fR]
1743
1755
.sp
1744
1756
Enable output paging\&. By using the
1745
1757
\fB\-\-pager\fR
1753
1765
environment variable and sets the pager to that\&. Pager functionality works only in interactive mode\&.
1754
1766
.sp
1755
1767
Output paging can be enabled interactively with the
1756
 
\fBpager\fR
 
1768
pager
1757
1769
command and disabled with
1758
 
\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
1759
1771
stdout
1760
1772
if no pager was specified\&.
1761
1773
.sp
1762
1774
Output paging works only in Unix because it uses the
1763
1775
popen()
1764
1776
function, which does not exist on Windows\&. For Windows, the
1765
 
\fBtee\fR
 
1777
tee
1766
1778
option can be used instead to save query output, although it is not as convenient as
1767
 
\fBpager\fR
 
1779
pager
1768
1780
for browsing output in some situations\&.
1769
1781
.RE
1770
1782
.sp
1778
1790
.\}
1779
1791
.\" mysql: print command
1780
1792
.\" print command: mysql
1781
 
\fBprint\fR,
1782
 
\fB\ep\fR
 
1793
print,
 
1794
\ep
1783
1795
.sp
1784
1796
Print the current input statement without executing it\&.
1785
1797
.RE
1794
1806
.\}
1795
1807
.\" mysql: prompt command
1796
1808
.\" prompt command: mysql
1797
 
\fBprompt [\fR\fB\fIstr\fR\fR\fB]\fR,
1798
 
\fB\eR [\fR\fB\fIstr\fR\fR\fB]\fR
 
1809
prompt [\fIstr\fR],
 
1810
\eR [\fIstr\fR]
1799
1811
.sp
1800
1812
Reconfigure the
1801
1813
\fBmysql\fR
1819
1831
.\}
1820
1832
.\" mysql: quit command
1821
1833
.\" quit command: mysql
1822
 
\fBquit\fR,
1823
 
\fB\eq\fR
 
1834
quit,
 
1835
\eq
1824
1836
.sp
1825
1837
Exit
1826
1838
\fBmysql\fR\&.
1836
1848
.\}
1837
1849
.\" mysql: rehash command
1838
1850
.\" rehash command: mysql
1839
 
\fBrehash\fR,
1840
 
\fB\e#\fR
 
1851
rehash,
 
1852
\e#
1841
1853
.sp
1842
1854
Rebuild the completion hash that enables database, table, and column name completion while you are entering statements\&. (See the description for the
1843
1855
\fB\-\-auto\-rehash\fR
1854
1866
.\}
1855
1867
.\" mysql: source command
1856
1868
.\" source command: mysql
1857
 
\fBsource \fR\fB\fIfile_name\fR\fR,
1858
 
\fB\e\&. \fR\fB\fIfile_name\fR\fR
 
1869
source \fIfile_name\fR,
 
1870
\e\&. \fIfile_name\fR
1859
1871
.sp
1860
1872
Read the named file and executes the statements contained therein\&. On Windows, you can specify path name separators as
1861
1873
/
1873
1885
.\}
1874
1886
.\" mysql: status command
1875
1887
.\" status command: mysql
1876
 
\fBstatus\fR,
1877
 
\fB\es\fR
 
1888
status,
 
1889
\es
1878
1890
.sp
1879
1891
Provide status information about the connection and the server you are using\&. If you are running in
1880
1892
\fB\-\-safe\-updates\fR
1895
1907
.\}
1896
1908
.\" mysql: system command
1897
1909
.\" system command: mysql
1898
 
\fBsystem \fR\fB\fIcommand\fR\fR,
1899
 
\fB\e! \fR\fB\fIcommand\fR\fR
 
1910
system \fIcommand\fR,
 
1911
\e! \fIcommand\fR
1900
1912
.sp
1901
1913
Execute the given command using your default command interpreter\&.
1902
1914
.sp
1903
1915
The
1904
 
\fBsystem\fR
 
1916
system
1905
1917
command works only in Unix\&.
1906
1918
.RE
1907
1919
.sp
1915
1927
.\}
1916
1928
.\" mysql: tee command
1917
1929
.\" tee command: mysql
1918
 
\fBtee [\fR\fB\fIfile_name\fR\fR\fB]\fR,
1919
 
\fB\eT [\fR\fB\fIfile_name\fR\fR\fB]\fR
 
1930
tee [\fIfile_name\fR],
 
1931
\eT [\fIfile_name\fR]
1920
1932
.sp
1921
1933
By using the
1922
1934
\fB\-\-tee\fR
1926
1938
flushes results to the file after each statement, just before it prints its next prompt\&. Tee functionality works only in interactive mode\&.
1927
1939
.sp
1928
1940
You can enable this feature interactively with the
1929
 
\fBtee\fR
 
1941
tee
1930
1942
command\&. Without a parameter, the previous file is used\&. The
1931
 
\fBtee\fR
 
1943
tee
1932
1944
file can be disabled with the
1933
 
\fBnotee\fR
 
1945
notee
1934
1946
command\&. Executing
1935
 
\fBtee\fR
 
1947
tee
1936
1948
again re\-enables logging\&.
1937
1949
.RE
1938
1950
.sp
1946
1958
.\}
1947
1959
.\" mysql: use command
1948
1960
.\" use command: mysql
1949
 
\fBuse \fR\fB\fIdb_name\fR\fR,
1950
 
\fB\eu \fR\fB\fIdb_name\fR\fR
 
1961
use \fIdb_name\fR,
 
1962
\eu \fIdb_name\fR
1951
1963
.sp
1952
1964
Use
1953
1965
\fIdb_name\fR
1964
1976
.\}
1965
1977
.\" mysql: warnings command
1966
1978
.\" warnings command: mysql
1967
 
\fBwarnings\fR,
1968
 
\fB\eW\fR
 
1979
warnings,
 
1980
\eW
1969
1981
.sp
1970
1982
Enable display of warnings after each statement (if there are any)\&.
1971
1983
.RE
1972
1984
.PP
1973
1985
Here are a few tips about the
1974
 
\fBpager\fR
 
1986
pager
1975
1987
command:
1976
1988
.sp
1977
1989
.RS 4
2096
2108
.RE
2097
2109
.PP
2098
2110
You can also combine the
2099
 
\fBtee\fR
 
2111
tee
2100
2112
and
2101
 
\fBpager\fR
 
2113
pager
2102
2114
functions\&. Have a
2103
 
\fBtee\fR
 
2115
tee
2104
2116
file enabled and
2105
 
\fBpager\fR
 
2117
pager
2106
2118
set to
2107
2119
\fBless\fR, and you are able to browse the results using the
2108
2120
\fBless\fR
2109
2121
program and still have everything appended into a file the same time\&. The difference between the Unix
2110
 
\fBtee\fR
 
2122
tee
2111
2123
used with the
2112
 
\fBpager\fR
 
2124
pager
2113
2125
command and the
2114
2126
\fBmysql\fR
2115
2127
built\-in
2116
 
\fBtee\fR
 
2128
tee
2117
2129
command is that the built\-in
2118
 
\fBtee\fR
 
2130
tee
2119
2131
works even if you do not have the Unix
2120
2132
\fBtee\fR
2121
2133
available\&. The built\-in
2122
 
\fBtee\fR
 
2134
tee
2123
2135
also logs everything that is printed on the screen, whereas the Unix
2124
2136
\fBtee\fR
2125
2137
used with
2126
 
\fBpager\fR
 
2138
pager
2127
2139
does not log quite that much\&. Additionally,
2128
 
\fBtee\fR
 
2140
tee
2129
2141
file logging can be turned on and off interactively from within
2130
2142
\fBmysql\fR\&. This is useful when you want to log some queries to a file, but not others\&.
2131
2143
.\" mysql prompt command
2132
2144
.PP
2133
2145
The
2134
 
\fBprompt\fR
 
2146
prompt
2135
2147
command reconfigures the default
2136
2148
mysql>
2137
2149
prompt\&. The string for defining the prompt can contain the following special sequences\&.
2811
2823
.\}
2812
2824
.PP
2813
2825
See
2814
 
Section\ \&5.1.4, \(lqServer System Variables\(rq\&.
 
2826
Section\ \&5.1.3, \(lqServer System Variables\(rq\&.
2815
2827
.PP
2816
2828
The
2817
2829
SET
2933
2945
option\&.
2934
2946
.PP
2935
2947
For more information about auto\-reconnect and its effect on state information when a reconnection occurs, see
2936
 
Section\ \&21.9.11, \(lqControlling Automatic Reconnection Behavior\(rq\&.
 
2948
Section\ \&20.9.11, \(lqControlling Automatic Reconnection Behavior\(rq\&.
2937
2949
.SH "COPYRIGHT"
2938
2950
.br
2939
2951
.PP
2940
 
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.
2941
2953
.PP
2942
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.
2943
2955
.PP
2945
2957
.PP
2946
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/.
2947
2959
.sp
2948
 
.SH "NOTES"
2949
 
.IP " 1." 4
2950
 
Bug#25946
2951
 
.RS 4
2952
 
\%http://bugs.mysql.com/bug.php?id=25946
2953
 
.RE
2954
2960
.SH "SEE ALSO"
2955
2961
For more information, please refer to the MySQL Reference Manual,
2956
2962
which may already be installed locally and which is also available