2
3
4
6 mysql_upgrade - check tables for MySQL upgrade
7
9 mysql_upgrade [options]
10
12 mysql_upgrade should be executed each time you upgrade MySQL. It checks
13 all tables in all databases for incompatibilities with the current
14 version of MySQL Server. If a table is found to have a possible
15 incompatibility, it is checked. If any problems are found, the table is
16 repaired. mysql_upgrade also upgrades the system tables so that you
17 can take advantage of new privileges or capabilities that might have
18 been added.
19
20 All checked and repaired tables are marked with the current MySQL
21 version number. This ensures that next time you run mysql_upgrade with
22 the same version of the server, it can tell whether there is any need
23 to check or repair the table again.
24
25 mysql_upgrade also saves the MySQL version number in a file named
26 mysql_upgrade.info in the data directory. This is used to quickly check
27 if all tables have been checked for this release so that table-checking
28 can be skipped. To ignore this file, use the --force option.
29
30 To check and repair tables and to upgrade the system tables,
31 mysql_upgrade executes the following commands:
32
33 mysqlcheck --check-upgrade --all-databases --auto-repair
34 mysql_fix_privilege_tables
35
36 mysql_upgrade supersedes the older mysql_fix_privilege_tables script.
37 In MySQL 5.0.19, mysql_upgrade was added as a shell script and worked
38 only for Unix systems. As of MySQL 5.0.25, mysql_upgrade is an
39 executable binary and is available on all systems. On systems older
40 than those supporting mysql_upgrade, you can execute the mysqlcheck
41 command manually, and then upgrade your system tables as described in
42 mysql_fix_privilege_tables(1).
43
44 For details about what is checked, see the description of the FOR
45 UPGRADE option of the CHECK TABLE statement (see Section 5.2.3, “CHECK
46 TABLE Syntax”).
47
48 To use mysql_upgrade, make sure that the server is running, and then
49 invoke it like this:
50
51 shell> mysql_upgrade [options]
52
53 mysql_upgrade reads options from the command line and from the
54 [mysql_upgrade] group in option files. It supports the following
55 options:
56
57 · --help
58
59 Display a short help message and exit.
60
61 · --basedir=path
62
63 The path to the MySQL installation directory.
64
65 · --datadir=path
66
67 The path to the data directory.
68
69 · --force
70
71 Force execution of mysqlcheck even if mysql_upgrade has already been
72 executed for the current version of MySQL. (In other words, this
73 option causes the mysql_upgrade.info file to be ignored.)
74
75 · --user=user_name, -u user_name
76
77 The MySQL username to use when connecting to the server. The default
78 username is root.
79
80 · --verbose
81
82 Verbose mode. Print more information about what the program does.
83
84
85 Other options are passed to mysqlcheck and to
86 mysql_fix_privilege_tables. For example, it might be necessary to
87 specify the --password[=password] option.
88
90 Copyright 1997-2007 MySQL AB
91
92 This documentation is NOT distributed under a GPL license. Use of this
93 documentation is subject to the following terms: You may create a
94 printed copy of this documentation solely for your own personal use.
95 Conversion to other formats is allowed as long as the actual content is
96 not altered or edited in any way. You shall not publish or distribute
97 this documentation in any form or on any media, except if you
98 distribute the documentation in a manner similar to how MySQL
99 disseminates it (that is, electronically for download on a Web site
100 with the software) or on a CD-ROM or similar medium, provided however
101 that the documentation is disseminated together with the software on
102 the same medium. Any other use, such as any dissemination of printed
103 copies or use of this documentation, in whole or in part, in another
104 publication, requires the prior written consent from an authorized
105 representative of MySQL AB. MySQL AB reserves any and all rights to
106 this documentation not expressly granted above.
107
108 Please email <docs@mysql.com> for more information.
109
111 For more information, please refer to the MySQL Reference Manual, which
112 may already be installed locally and which is also available online at
113 http://dev.mysql.com/doc/.
114
116 MySQL AB (http://www.mysql.com/). This software comes with no
117 warranty.
118
119
120
121MySQL 5.0 07/04/2007 MYSQL_UPGRADE(1)