1MYSQL_UPGRADE(1) MariaDB Database System MYSQL_UPGRADE(1)
2
3
4
6 mysql_upgrade - check tables for MariaDB upgrade
7
9 mysql_upgrade [options]
10
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 For this reason, mysql_upgrade needs to be run as a user with write
78 access to the data directory.
79
80 If you install MariaDB from RPM packages on Linux, you must install the
81 server and client RPMs. mysql_upgrade is included in the server RPM
82 but requires the client RPM because the latter includes mysqlcheck.
83
84 mysql_upgrade supports the following options, which can be specified on
85 the command line or in the [mysql_upgrade] and [client] option file
86 groups. Other options are passed to mysqlcheck. For example, it might
87 be necessary to specify the --password[=password] option.
88 mysql_upgrade also supports the options for processing option files.
89
90 · --help, -?
91
92 Display a short help message and exit.
93
94 · --basedir=path
95
96 Old option accepted for backward compatibility but ignored.
97
98 · --character-sets-dir=path
99
100 Old option accepted for backward compatibility but ignored.
101
102 · --datadir=path
103
104 Old option accepted for backward compatibility but ignored.
105
106 · --debug=path, -# path
107
108 For debug builds, output debug log.
109
110 · --debug-check
111
112 Print some debugging information when the program exits.
113
114 · --debug-info, -T
115
116 Print debugging information and memory and CPU usage statistics
117 when the program exits.
118
119 · --default-character-set=name
120
121 Old option accepted for backward compatibility but ignored.
122
123 · --force
124
125 Ignore the mysql_upgrade_info file and force execution of
126 mysqlcheck even if mysql_upgrade has already been executed for the
127 current version of MariaDB.
128
129 · --host
130
131 Connect to MariaDB on the given host.
132
133 · --password[=password], -p[password]
134
135 The password to use when connecting to the server. If you use the
136 short option form (-p), you cannot have a space between the option
137 and the password. If you omit the password value following the
138 --password or -p option on the command line, mysql_upgrade prompts
139 for one.
140
141 Specifying a password on the command line should be considered
142 insecure. You can use an option file to avoid giving the password
143 on the command line.
144
145 · --port=port_num, -P port_num
146
147 The TCP/IP port number to use for the connection.
148
149 · --protocol={TCP|SOCKET|PIPE|MEMORY}
150
151 The connection protocol to use for connecting to the server. It is
152 useful when the other connection parameters normally would cause a
153 protocol to be used other than the one you want.
154
155 · --silent
156
157 Print less information.
158
159 · --socket=path, -S path
160
161 For connections to localhost, the Unix socket file to use, or, on
162 Windows, the name of the named pipe to use.
163
164 · --ssl
165
166 Enable SSL for connection (automatically enabled with other flags).
167 Disable with --skip-ssl.
168
169 · --ssl-ca=name
170
171 CA file in PEM format (check OpenSSL docs, implies --ssl).
172
173 · --ssl-capath=name
174
175 CA directory (check OpenSSL docs, implies --ssl).
176
177 · --ssl-cert=name
178
179 X509 cert in PEM format (check OpenSSL docs, implies --ssl).
180
181 · --ssl-cipher=name
182
183 SSL cipher to use (check OpenSSL docs, implies --ssl).
184
185 · --ssl-key=name
186
187 X509 key in PEM format (check OpenSSL docs, implies --ssl).
188
189 · --ssl-crl=name
190
191 Certificate revocation list (check OpenSSL docs, implies --ssl).
192
193 · --ssl-crlpath=name
194
195 Certificate revocation list path (check OpenSSL docs, implies
196 --ssl).
197
198 · --ssl-verify-server-cert
199
200 Verify server's "Common Name" in its cert against hostname used
201 when connecting. This option is disabled by default.
202
203 · --tmpdir=path, -t path
204
205 The path name of the directory to use for creating temporary files.
206
207 · --upgrade-system-tables, -s
208
209 Only upgrade the system tables in the mysql database. Tables in
210 other databases are not checked or touched.
211
212 · --user=user_name, -u user_name
213
214 The MariaDB user name to use when connecting to the server and not
215 using the current login.
216
217 · --verbose
218
219 Display more output about the process. Using it twice will print
220 connection arguments; using it 3 times will print out all CHECK,
221 RENAME and ALTER TABLE commands used during the check phase; using
222 it 4 times (added in MariaDB 10.0.14) will also write out all
223 mysqlcheck commands used.
224
225 · --version, -V
226
227 Output version information and exit.
228
229 · --version-check, -k
230
231 Run this program only if its 'server version' matches the version
232 of the server to which it's connecting. Note: the 'server version'
233 of the program is the version of the MariaDB server with which it
234 was built/distributed. Defaults to on; use --skip-version-check to
235 disable.
236
237 · --write-binlog
238
239 Cause binary logging to be enabled while mysql_upgrade runs.
240
242 Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.,
243 2010-2015 MariaDB Foundation
244
245 This documentation is free software; you can redistribute it and/or
246 modify it only under the terms of the GNU General Public License as
247 published by the Free Software Foundation; version 2 of the License.
248
249 This documentation is distributed in the hope that it will be useful,
250 but WITHOUT ANY WARRANTY; without even the implied warranty of
251 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
252 General Public License for more details.
253
254 You should have received a copy of the GNU General Public License along
255 with the program; if not, write to the Free Software Foundation, Inc.,
256 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see
257 http://www.gnu.org/licenses/.
258
259
261 For more information, please refer to the MariaDB Knowledge Base,
262 available online at https://mariadb.com/kb/
263
265 MariaDB Foundation (http://www.mariadb.org/).
266
267
268
269MariaDB 10.4 20 July 2020 MYSQL_UPGRADE(1)