1MYSQLADMIN(1) MySQL Database System MYSQLADMIN(1)
2
3
4
6 mysqladmin - client for administering a MySQL server
7
9 mysqladmin [options] command [command-options] [command
10 [command-options]]
11 ...
12
14 mysqladmin is a client for performing administrative operations. You
15 can use it to check the server's configuration and current status, to
16 create and drop databases, and more.
17
18 Invoke mysqladmin like this:
19
20 shell> mysqladmin [options] command [command-arg] [command [command-arg]] ...
21
22 mysqladmin supports the following commands. Some of the commands take
23 an argument following the command name.
24
25 · create db_name
26
27 Create a new database named db_name.
28
29 · debug
30
31 Tell the server to write debug information to the error log. The
32 connected user must have the SUPER privilege. Format and content of
33 this information is subject to change.
34
35 This includes information about the Event Scheduler. See
36 Section 24.4.5, “Event Scheduler Status”.
37
38 · drop db_name
39
40 Delete the database named db_name and all its tables.
41
42 · extended-status
43
44 Display the server status variables and their values.
45
46 · flush-hosts
47
48 Flush all information in the host cache. See Section 8.12.4.2, “DNS
49 Lookup Optimization and the Host Cache”.
50
51 · flush-logs [log_type ...]
52
53 Flush all logs.
54
55 The mysqladmin flush-logs command permits optional log types to be
56 given, to specify which logs to flush. Following the flush-logs
57 command, you can provide a space-separated list of one or more of
58 the following log types: binary, engine, error, general, relay,
59 slow. These correspond to the log types that can be specified for
60 the FLUSH LOGS SQL statement.
61
62 · flush-privileges
63
64 Reload the grant tables (same as reload).
65
66 · flush-status
67
68 Clear status variables.
69
70 · flush-tables
71
72 Flush all tables.
73
74 · flush-threads
75
76 Flush the thread cache.
77
78 · kill id,id,...
79
80 Kill server threads. If multiple thread ID values are given, there
81 must be no spaces in the list.
82
83 To kill threads belonging to other users, the connected user must
84 have the CONNECTION_ADMIN or SUPER privilege.
85
86 · password new_password
87
88 Set a new password. This changes the password to new_password for
89 the account that you use with mysqladmin for connecting to the
90 server. Thus, the next time you invoke mysqladmin (or any other
91 client program) using the same account, you will need to specify
92 the new password.
93
94 Warning
95 Setting a password using mysqladmin should be considered
96 insecure. On some systems, your password becomes visible to
97 system status programs such as ps that may be invoked by other
98 users to display command lines. MySQL clients typically
99 overwrite the command-line password argument with zeros during
100 their initialization sequence. However, there is still a brief
101 interval during which the value is visible. Also, on some
102 systems this overwriting strategy is ineffective and the
103 password remains visible to ps. (SystemV Unix systems and
104 perhaps others are subject to this problem.)
105 If the new_password value contains spaces or other characters that
106 are special to your command interpreter, you need to enclose it
107 within quotation marks. On Windows, be sure to use double quotation
108 marks rather than single quotation marks; single quotation marks
109 are not stripped from the password, but rather are interpreted as
110 part of the password. For example:
111
112 shell> mysqladmin password "my new password"
113
114 The new password can be omitted following the password command. In
115 this case, mysqladmin prompts for the password value, which enables
116 you to avoid specifying the password on the command line. Omitting
117 the password value should be done only if password is the final
118 command on the mysqladmin command line. Otherwise, the next
119 argument is taken as the password.
120
121 Caution
122 Do not use this command used if the server was started with the
123 --skip-grant-tables option. No password change will be applied.
124 This is true even if you precede the password command with
125 flush-privileges on the same command line to re-enable the
126 grant tables because the flush operation occurs after you
127 connect. However, you can use mysqladmin flush-privileges to
128 re-enable the grant table and then use a separate mysqladmin
129 password command to change the password.
130
131 · ping
132
133 Check whether the server is available. The return status from
134 mysqladmin is 0 if the server is running, 1 if it is not. This is 0
135 even in case of an error such as Access denied, because this means
136 that the server is running but refused the connection, which is
137 different from the server not running.
138
139 · processlist
140
141 Show a list of active server threads. This is like the output of
142 the SHOW PROCESSLIST statement. If the --verbose option is given,
143 the output is like that of SHOW FULL PROCESSLIST. (See
144 Section 13.7.7.29, “SHOW PROCESSLIST Syntax”.)
145
146 · reload
147
148 Reload the grant tables.
149
150 · refresh
151
152 Flush all tables and close and open log files.
153
154 · shutdown
155
156 Stop the server.
157
158 · start-slave
159
160 Start replication on a slave server.
161
162 · status
163
164 Display a short server status message.
165
166 · stop-slave
167
168 Stop replication on a slave server.
169
170 · variables
171
172 Display the server system variables and their values.
173
174 · version
175
176 Display version information from the server.
177
178 All commands can be shortened to any unique prefix. For example:
179
180 shell> mysqladmin proc stat
181 +----+-------+-----------+----+---------+------+-------+------------------+
182 | Id | User | Host | db | Command | Time | State | Info |
183 +----+-------+-----------+----+---------+------+-------+------------------+
184 | 51 | jones | localhost | | Query | 0 | | show processlist |
185 +----+-------+-----------+----+---------+------+-------+------------------+
186 Uptime: 1473624 Threads: 1 Questions: 39487
187 Slow queries: 0 Opens: 541 Flush tables: 1
188 Open tables: 19 Queries per second avg: 0.0268
189
190 The mysqladmin status command result displays the following values:
191
192 · Uptime
193
194 The number of seconds the MySQL server has been running.
195
196 · Threads
197
198 The number of active threads (clients).
199
200 · Questions
201
202 The number of questions (queries) from clients since the server was
203 started.
204
205 · Slow queries
206
207 The number of queries that have taken more than long_query_time
208 seconds. See Section 5.4.5, “The Slow Query Log”.
209
210 · Opens
211
212 The number of tables the server has opened.
213
214 · Flush tables
215
216 The number of flush-*, refresh, and reload commands the server has
217 executed.
218
219 · Open tables
220
221 The number of tables that currently are open.
222
223 If you execute mysqladmin shutdown when connecting to a local server
224 using a Unix socket file, mysqladmin waits until the server's process
225 ID file has been removed, to ensure that the server has stopped
226 properly.
227
228 mysqladmin supports the following options, which can be specified on
229 the command line or in the [mysqladmin] and [client] groups of an
230 option file. For information about option files used by MySQL programs,
231 see Section 4.2.2.2, “Using Option Files”.
232
233 · --help, -?
234
235 Display a help message and exit.
236
237 · --bind-address=ip_address
238
239 On a computer having multiple network interfaces, use this option
240 to select which interface to use for connecting to the MySQL
241 server.
242
243 · --character-sets-dir=dir_name
244
245 The directory where character sets are installed. See
246 Section 10.15, “Character Set Configuration”.
247
248 · --compress, -C
249
250 Compress all information sent between the client and the server if
251 possible. See Section 4.2.6, “Connection Compression Control”.
252
253 As of MySQL 8.0.18, this option is deprecated. It will be removed
254 in a future MySQL version. See the section called “Legacy
255 Connection Compression Configuration”.
256
257 · --compression-algorithms=value The permitted compression algorithms
258 for connections to the server. The available algorithms are the
259 same as for the protocol_compression_algorithms system variable.
260 The default value is uncompressed.
261
262 For more information, see Section 4.2.6, “Connection Compression
263 Control”.
264
265 This option was added in MySQL 8.0.18.
266
267 · --count=N, -c N
268
269 The number of iterations to make for repeated command execution if
270 the --sleep option is given.
271
272 · --debug[=debug_options], -# [debug_options]
273
274 Write a debugging log. A typical debug_options string is
275 d:t:o,file_name. The default is d:t:o,/tmp/mysqladmin.trace.
276
277 · --debug-check
278
279 Print some debugging information when the program exits.
280
281 · --debug-info
282
283 Print debugging information and memory and CPU usage statistics
284 when the program exits.
285
286 · --default-auth=plugin
287
288 A hint about which client-side authentication plugin to use. See
289 Section 6.2.17, “Pluggable Authentication”.
290
291 · --default-character-set=charset_name
292
293 Use charset_name as the default character set. See Section 10.15,
294 “Character Set Configuration”.
295
296 · --defaults-extra-file=file_name
297
298 Read this option file after the global option file but (on Unix)
299 before the user option file. If the file does not exist or is
300 otherwise inaccessible, an error occurs. file_name is interpreted
301 relative to the current directory if given as a relative path name
302 rather than a full path name.
303
304 For additional information about this and other option-file
305 options, see Section 4.2.2.3, “Command-Line Options that Affect
306 Option-File Handling”.
307
308 · --defaults-file=file_name
309
310 Use only the given option file. If the file does not exist or is
311 otherwise inaccessible, an error occurs. file_name is interpreted
312 relative to the current directory if given as a relative path name
313 rather than a full path name.
314
315 Exception: Even with --defaults-file, client programs read
316 .mylogin.cnf.
317
318 For additional information about this and other option-file
319 options, see Section 4.2.2.3, “Command-Line Options that Affect
320 Option-File Handling”.
321
322 · --defaults-group-suffix=str
323
324 Read not only the usual option groups, but also groups with the
325 usual names and a suffix of str. For example, mysqladmin normally
326 reads the [client] and [mysqladmin] groups. If the
327 --defaults-group-suffix=_other option is given, mysqladmin also
328 reads the [client_other] and [mysqladmin_other] groups.
329
330 For additional information about this and other option-file
331 options, see Section 4.2.2.3, “Command-Line Options that Affect
332 Option-File Handling”.
333
334 · --enable-cleartext-plugin
335
336 Enable the mysql_clear_password cleartext authentication plugin.
337 (See Section 6.4.1.4, “Client-Side Cleartext Pluggable
338 Authentication”.)
339
340 · --force, -f
341
342 Do not ask for confirmation for the drop db_name command. With
343 multiple commands, continue even if an error occurs.
344
345 · --get-server-public-key
346
347 Request from the server the public key required for RSA key
348 pair-based password exchange. This option applies to clients that
349 authenticate with the caching_sha2_password authentication plugin.
350 For that plugin, the server does not send the public key unless
351 requested. This option is ignored for accounts that do not
352 authenticate with that plugin. It is also ignored if RSA-based
353 password exchange is not used, as is the case when the client
354 connects to the server using a secure connection.
355
356 If --server-public-key-path=file_name is given and specifies a
357 valid public key file, it takes precedence over
358 --get-server-public-key.
359
360 For information about the caching_sha2_password plugin, see
361 Section 6.4.1.3, “Caching SHA-2 Pluggable Authentication”.
362
363 · --host=host_name, -h host_name
364
365 Connect to the MySQL server on the given host.
366
367 · --login-path=name
368
369 Read options from the named login path in the .mylogin.cnf login
370 path file. A “login path” is an option group containing options
371 that specify which MySQL server to connect to and which account to
372 authenticate as. To create or modify a login path file, use the
373 mysql_config_editor utility. See mysql_config_editor(1).
374
375 For additional information about this and other option-file
376 options, see Section 4.2.2.3, “Command-Line Options that Affect
377 Option-File Handling”.
378
379 · --no-beep, -b
380
381 Suppress the warning beep that is emitted by default for errors
382 such as a failure to connect to the server.
383
384 · --no-defaults
385
386 Do not read any option files. If program startup fails due to
387 reading unknown options from an option file, --no-defaults can be
388 used to prevent them from being read.
389
390 The exception is that the .mylogin.cnf file, if it exists, is read
391 in all cases. This permits passwords to be specified in a safer way
392 than on the command line even when --no-defaults is used.
393 (.mylogin.cnf is created by the mysql_config_editor utility. See
394 mysql_config_editor(1).)
395
396 For additional information about this and other option-file
397 options, see Section 4.2.2.3, “Command-Line Options that Affect
398 Option-File Handling”.
399
400 · --password[=password], -p[password]
401
402 The password of the MySQL account used for connecting to the
403 server. The password value is optional. If not given, mysqladmin
404 prompts for one. If given, there must be no space between
405 --password= or -p and the password following it. If no password
406 option is specified, the default is to send no password.
407
408 Specifying a password on the command line should be considered
409 insecure. To avoid giving the password on the command line, use an
410 option file. See Section 6.1.2.1, “End-User Guidelines for Password
411 Security”.
412
413 To explicitly specify that there is no password and that mysqladmin
414 should not prompt for one, use the --skip-password option.
415
416 · --pipe, -W
417
418 On Windows, connect to the server using a named pipe. This option
419 applies only if the server was started with the named_pipe system
420 variable enabled to support named-pipe connections. In addition,
421 the user making the connection must be a member of the Windows
422 group specified by the named_pipe_full_access_group system
423 variable.
424
425 · --plugin-dir=dir_name
426
427 The directory in which to look for plugins. Specify this option if
428 the --default-auth option is used to specify an authentication
429 plugin but mysqladmin does not find it. See Section 6.2.17,
430 “Pluggable Authentication”.
431
432 · --port=port_num, -P port_num
433
434 For TCP/IP connections, the port number to use.
435
436 · --print-defaults
437
438 Print the program name and all options that it gets from option
439 files.
440
441 For additional information about this and other option-file
442 options, see Section 4.2.2.3, “Command-Line Options that Affect
443 Option-File Handling”.
444
445 · --protocol={TCP|SOCKET|PIPE|MEMORY}
446
447 The connection protocol to use for connecting to the server. It is
448 useful when the other connection parameters normally result in use
449 of a protocol other than the one you want. For details on the
450 permissible values, see Section 4.2.4, “Connecting to the MySQL
451 Server Using Command Options”.
452
453 · --relative, -r
454
455 Show the difference between the current and previous values when
456 used with the --sleep option. This option works only with the
457 extended-status command.
458
459 · --secure-auth
460
461 This option was removed in MySQL 8.0.3.
462
463 · --server-public-key-path=file_name
464
465 The path name to a file containing a client-side copy of the public
466 key required by the server for RSA key pair-based password
467 exchange. The file must be in PEM format. This option applies to
468 clients that authenticate with the sha256_password or
469 caching_sha2_password authentication plugin. This option is ignored
470 for accounts that do not authenticate with one of those plugins. It
471 is also ignored if RSA-based password exchange is not used, as is
472 the case when the client connects to the server using a secure
473 connection.
474
475 If --server-public-key-path=file_name is given and specifies a
476 valid public key file, it takes precedence over
477 --get-server-public-key.
478
479 For sha256_password, this option applies only if MySQL was built
480 using OpenSSL.
481
482 For information about the sha256_password and caching_sha2_password
483 plugins, see Section 6.4.1.2, “SHA-256 Pluggable Authentication”,
484 and Section 6.4.1.3, “Caching SHA-2 Pluggable Authentication”.
485
486 · --shared-memory-base-name=name
487
488 On Windows, the shared-memory name to use for connections made
489 using shared memory to a local server. The default value is MYSQL.
490 The shared-memory name is case-sensitive.
491
492 This option applies only if the server was started with the
493 shared_memory system variable enabled to support shared-memory
494 connections.
495
496 · --show-warnings
497
498 Show warnings resulting from execution of statements sent to the
499 server.
500
501 · --silent, -s
502
503 Exit silently if a connection to the server cannot be established.
504
505 · --sleep=delay, -i delay
506
507 Execute commands repeatedly, sleeping for delay seconds in between.
508 The --count option determines the number of iterations. If --count
509 is not given, mysqladmin executes commands indefinitely until
510 interrupted.
511
512 · --socket=path, -S path
513
514 For connections to localhost, the Unix socket file to use, or, on
515 Windows, the name of the named pipe to use.
516
517 On Windows, this option applies only if the server was started with
518 the named_pipe system variable enabled to support named-pipe
519 connections. In addition, the user making the connection must be a
520 member of the Windows group specified by the
521 named_pipe_full_access_group system variable.
522
523 · --ssl*
524
525 Options that begin with --ssl specify whether to connect to the
526 server using SSL and indicate where to find SSL keys and
527 certificates. See the section called “Command Options for Encrypted
528 Connections”.
529
530 · --ssl-fips-mode={OFF|ON|STRICT} Controls whether to enable FIPS
531 mode on the client side. The --ssl-fips-mode option differs from
532 other --ssl-xxx options in that it is not used to establish
533 encrypted connections, but rather to affect which cryptographic
534 operations are permitted. See Section 6.5, “FIPS Support”.
535
536 These --ssl-fips-mode values are permitted:
537
538 · OFF: Disable FIPS mode.
539
540 · ON: Enable FIPS mode.
541
542 · STRICT: Enable “strict” FIPS mode.
543
544
545 Note
546 If the OpenSSL FIPS Object Module is not available, the only
547 permitted value for --ssl-fips-mode is OFF. In this case,
548 setting --ssl-fips-mode to ON or STRICT causes the client to
549 produce a warning at startup and to operate in non-FIPS mode.
550
551 · --tls-ciphersuites=ciphersuite_list
552
553 The permissible ciphersuites for encrypted connections that use
554 TLSv1.3. The value is a list of one or more colon-separated
555 ciphersuite names. The ciphersuites that can be named for this
556 option depend on the SSL library used to compile MySQL. For
557 details, see Section 6.3.2, “Encrypted Connection TLS Protocols and
558 Ciphers”.
559
560 This option was added in MySQL 8.0.16.
561
562 · --tls-version=protocol_list
563
564 The permissible TLS protocols for encrypted connections. The value
565 is a list of one or more comma-separated protocol names. The
566 protocols that can be named for this option depend on the SSL
567 library used to compile MySQL. For details, see Section 6.3.2,
568 “Encrypted Connection TLS Protocols and Ciphers”.
569
570 · --user=user_name, -u user_name
571
572 The user name of the MySQL account to use for connecting to the
573 server.
574
575 · --verbose, -v
576
577 Verbose mode. Print more information about what the program does.
578
579 · --version, -V
580
581 Display version information and exit.
582
583 · --vertical, -E
584
585 Print output vertically. This is similar to --relative, but prints
586 output vertically.
587
588 · --wait[=count], -w[count]
589
590 If the connection cannot be established, wait and retry instead of
591 aborting. If a count value is given, it indicates the number of
592 times to retry. The default is one time.
593
594 · --zstd-compression-level=level The compression level to use for
595 connections to the server that use the zstd compression algorithm.
596 The permitted levels are from 1 to 22, with larger values
597 indicating increasing levels of compression. The default zstd
598 compression level is 3. The compression level setting has no effect
599 on connections that do not use zstd compression.
600
601 For more information, see Section 4.2.6, “Connection Compression
602 Control”.
603
604 This option was added in MySQL 8.0.18.
605
606 You can also set the following variables by using --var_name=value.
607
608 · connect_timeout
609
610 The maximum number of seconds before connection timeout. The
611 default value is 43200 (12 hours).
612
613 · shutdown_timeout
614
615 The maximum number of seconds to wait for server shutdown. The
616 default value is 3600 (1 hour).
617
619 Copyright © 1997, 2019, Oracle and/or its affiliates. All rights
620 reserved.
621
622 This documentation is free software; you can redistribute it and/or
623 modify it only under the terms of the GNU General Public License as
624 published by the Free Software Foundation; version 2 of the License.
625
626 This documentation is distributed in the hope that it will be useful,
627 but WITHOUT ANY WARRANTY; without even the implied warranty of
628 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
629 General Public License for more details.
630
631 You should have received a copy of the GNU General Public License along
632 with the program; if not, write to the Free Software Foundation, Inc.,
633 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
634 http://www.gnu.org/licenses/.
635
636
638 For more information, please refer to the MySQL Reference Manual, which
639 may already be installed locally and which is also available online at
640 http://dev.mysql.com/doc/.
641
643 Oracle Corporation (http://dev.mysql.com/).
644
645
646
647MySQL 8.0 09/06/2019 MYSQLADMIN(1)