1MYSQL_UPGRADE(1)            MariaDB Database System           MYSQL_UPGRADE(1)
2
3
4

NAME

6       mysql_upgrade - check tables for MariaDB upgrade
7

SYNOPSIS

9       mysql_upgrade [options]
10

DESCRIPTION

12       mysql_upgrade examines all tables in all databases for
13       incompatibilities with the current version of the MariaDB Server.
14       mysql_upgrade also upgrades the system tables so that you can take
15       advantage of new privileges or capabilities that might have been added.
16
17       mysql_upgrade should be executed each time you upgrade MariaDB.
18
19       If a table is found to have a possible incompatibility, mysql_upgrade
20       performs a table check. If any problems are found, a table repair is
21       attempted.
22
23           Note
24           On Windows Server 2008 and Windows Vista, you must run
25           mysql_upgrade with administrator privileges. You can do this by
26           running a Command Prompt as Administrator and running the command.
27           Failure to do so may result in the upgrade failing to execute
28           correctly.
29
30           Caution
31           You should always back up your current MariaDB installation before
32           performing an upgrade.
33
34       To use mysql_upgrade, make sure that the server is running, and then
35       invoke it like this:
36
37           shell> mysql_upgrade [options]
38
39       After running mysql_upgrade, stop the server and restart it so that any
40       changes made to the system tables take effect.
41
42       mysql_upgrade executes the following commands to check and repair
43       tables and to upgrade the system tables:
44
45           mysqlcheck --all-databases --check-upgrade --auto-repair
46           mysql < fix_priv_tables
47           mysqlcheck --all-databases --check-upgrade --fix-db-names --fix-table-names
48
49       Notes about the preceding commands:
50
51       ·   Because mysql_upgrade invokes mysqlcheck with the --all-databases
52           option, it processes all tables in all databases, which might take
53           a long time to complete. Each table is locked and therefore
54           unavailable to other sessions while it is being processed. Check
55           and repair operations can be time-consuming, particularly for large
56           tables.
57
58       ·   For details about what checks the --check-upgrade option entails,
59           see the description of the FOR UPGRADE option of the CHECK TABLE
60           statement.
61
62       ·   fix_priv_tables represents a script generated internally by
63           mysql_upgrade that contains SQL statements to upgrade the tables in
64           the mysql database.
65
66       All checked and repaired tables are marked with the current MariaDB
67       version number. This ensures that next time you run mysql_upgrade with
68       the same version of the server, it can tell whether there is any need
69       to check or repair the table again.
70
71       mysql_upgrade also saves the MariaDB version number in a file named
72       mysql_upgrade_info in the data directory. This is used to quickly check
73       whether all tables have been checked for this release so that
74       table-checking can be skipped. To ignore this file and perform the
75       check regardless, use the --force option.
76
77       If you install MariaDB from RPM packages on Linux, you must install the
78       server and client RPMs.  mysql_upgrade is included in the server RPM
79       but requires the client RPM because the latter includes mysqlcheck.
80
81       mysql_upgrade supports the following options, which can be specified on
82       the command line or in the [mysql_upgrade] and [client] option file
83       groups. Other options are passed to mysqlcheck. For example, it might
84       be necessary to specify the --password[=password] option.
85       mysql_upgrade also supports the options for processing option files.
86
87       ·   --help, -?
88
89           Display a short help message and exit.
90
91       ·   --basedir=path
92
93           Old option accepted for backward compatibility but ignored.
94
95       ·   --character-sets-dir=path
96
97           Old option accepted for backward compatibility but ignored.
98
99       ·   --datadir=path
100
101           Old option accepted for backward compatibility but ignored.
102
103       ·   --debug=path, -# path
104
105           For debug builds, output debug log.
106
107       ·   --debug-check
108
109           Print some debugging information when the program exits.
110
111       ·   --debug-info, -T
112
113           Print debugging information and memory and CPU usage statistics
114           when the program exits.
115
116       ·   --default-character-set=name
117
118           Old option accepted for backward compatibility but ignored.
119
120       ·   --force
121
122           Ignore the mysql_upgrade_info file and force execution of
123           mysqlcheck even if mysql_upgrade has already been executed for the
124           current version of MariaDB.
125
126       ·   --host
127
128           Connect to MariaDB on the given host.
129
130       ·   --password[=password], -p[password]
131
132           The password to use when connecting to the server. If you use the
133           short option form (-p), you cannot have a space between the option
134           and the password. If you omit the password value following the
135           --password or -p option on the command line, mysql_upgrade prompts
136           for one.
137
138           Specifying a password on the command line should be considered
139           insecure. You can use an option file to avoid giving the password
140           on the command line.
141
142       ·   --port=port_num, -P port_num
143
144           The TCP/IP port number to use for the connection.
145
146       ·   --protocol={TCP|SOCKET|PIPE|MEMORY}
147
148           The connection protocol to use for connecting to the server. It is
149           useful when the other connection parameters normally would cause a
150           protocol to be used other than the one you want.
151
152       ·   --silent
153
154           Print less information.
155
156       ·   --socket=path, -S path
157
158           For connections to localhost, the Unix socket file to use, or, on
159           Windows, the name of the named pipe to use.
160
161       ·   --ssl
162
163           Enable SSL for connection (automatically enabled with other flags).
164           Disable with --skip-ssl.
165
166       ·   --ssl-ca=name
167
168           CA file in PEM format (check OpenSSL docs, implies --ssl).
169
170       ·   --ssl-capath=name
171
172           CA directory (check OpenSSL docs, implies --ssl).
173
174       ·   --ssl-cert=name
175
176           X509 cert in PEM format (check OpenSSL docs, implies --ssl).
177
178       ·   --ssl-cipher=name
179
180           SSL cipher to use (check OpenSSL docs, implies --ssl).
181
182       ·   --ssl-key=name
183
184           X509 key in PEM format (check OpenSSL docs, implies --ssl).
185
186       ·   --ssl-crl=name
187
188           Certificate revocation list (check OpenSSL docs, implies --ssl).
189
190       ·   --ssl-crlpath=name
191
192           Certificate revocation list path (check OpenSSL docs, implies
193           --ssl).
194
195       ·   --ssl-verify-server-cert
196
197           Verify server's "Common Name" in its cert against hostname used
198           when connecting. This option is disabled by default.
199
200       ·   --tmpdir=path, -t path
201
202           The path name of the directory to use for creating temporary files.
203
204       ·   --upgrade-system-tables, -s
205
206           Only upgrade the system tables in the mysql database. Tables in
207           other databases are not checked or touched.
208
209       ·   --user=user_name, -u user_name
210
211           The MariaDB user name to use when connecting to the server and not
212           using the current login.
213
214       ·   --verbose
215
216           Display more output about the process. Using it twice will print
217           connection arguments; using it 3 times will print out all CHECK,
218           RENAME and ALTER TABLE commands used during the check phase; using
219           it 4 times (added in MariaDB 10.0.14) will also write out all
220           mysqlcheck commands used.
221
222       ·   --version, -V
223
224           Output version information and exit.
225
226       ·   --version-check, -k
227
228           Run this program only if its 'server version' matches the version
229           of the server to which it's connecting. Note: the 'server version'
230           of the program is the version of the MariaDB server with which it
231           was built/distributed. Defaults to on; use --skip-version-check to
232           disable.
233
234       ·   --write-binlog
235
236           Cause binary logging to be enabled while mysql_upgrade runs.
237
239       Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.,
240       2010-2015 MariaDB Foundation
241
242       This documentation is free software; you can redistribute it and/or
243       modify it only under the terms of the GNU General Public License as
244       published by the Free Software Foundation; version 2 of the License.
245
246       This documentation is distributed in the hope that it will be useful,
247       but WITHOUT ANY WARRANTY; without even the implied warranty of
248       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
249       General Public License for more details.
250
251       You should have received a copy of the GNU General Public License along
252       with the program; if not, write to the Free Software Foundation, Inc.,
253       51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see
254       http://www.gnu.org/licenses/.
255
256

SEE ALSO

258       For more information, please refer to the MariaDB Knowledge Base,
259       available online at https://mariadb.com/kb/
260

AUTHOR

262       MariaDB Foundation (http://www.mariadb.org/).
263
264
265
266MariaDB 10.4                     28 March 2019                MYSQL_UPGRADE(1)
Impressum