Table Maintenance Statements
1162
For more information about setting passwords, see
Section 6.3.5, “Assigning Account Passwords”
Important
SET PASSWORD
may be recorded in server logs or in a history file such as
~/.mysql_history
, which means that cleartext passwords may be read by
anyone having read access to that information. See
Section 6.1.2, “Keeping
Passwords Secure”
.
Caution
If you are connecting to a MySQL 4.1 or later server using a pre-4.1 client
program, do not change your password without first reading
Section 6.1.2.4,
“Password Hashing in MySQL”
. The default password hashing format changed
in MySQL 4.1, and if you change your password, it might be stored using a
hashing format that pre-4.1 clients cannot generate, thus preventing you from
connecting to the server afterward.
If you are using MySQL Replication, be aware that, currently, a password used by a replication slave
as part of a
CHANGE MASTER TO
statement is effectively limited to 32 characters in length; the
password can be longer, but any excess characters are truncated. This is not due to any limit imposed
by the MySQL Server generally, but rather is an issue specific to MySQL Replication. (For more
information, see Bug #43439.)
13.7.2. Table Maintenance Statements
13.7.2.1.
ANALYZE TABLE
Syntax
ANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE
tbl_name
[,
tbl_name
] ...
ANALYZE TABLE
analyzes and stores the key distribution for a table. During the analysis, the table
is locked with a read lock for
MyISAM
,
BDB
, and
InnoDB
. This statement works with
MyISAM
,
BDB
,
InnoDB
, and
NDB
tables. For
MyISAM
tables, this statement is equivalent to using
myisamchk --
analyze
-
For more information on how the analysis works within
InnoDB
, see
Section 14.2.13, “Limits on
InnoDB
Tables”
.
MySQL uses the stored key distribution to decide the order in which tables should be joined when you
perform a join on something other than a constant. In addition, key distributions can be used when
deciding which indexes to use for a specific table within a query.
This statement requires
SELECT
[578]
and
INSERT
[577]
privileges for the table.
ANALYZE TABLE
returns a result set with the following columns.
Column
Value
Table
The table name
Op
Always
analyze
Msg_type
status
,
error
,
info
,
note
, or
warning
Msg_text
An informational message
You can check the stored key distribution with the
SHOW INDEX
statement. See
Section 13.7.5.18,
“
SHOW INDEX
Syntax”
.
If the table has not changed since the last
ANALYZE TABLE
statement, the table is not analyzed again.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...