1MARIADB-ADMIN(1)            MariaDB Database System           MARIADB-ADMIN(1)
2
3
4

NAME

6       mariadb-admin - client for administering a MariaDB server (mysqladmin
7       is now a symlink to mariadb-admin)
8

SYNOPSIS

10       mysqladmin [options] command [command-arg] [command [command-arg]] ...
11

DESCRIPTION

13       mysqladmin is a client for performing administrative operations. You
14       can use it to check the server´s configuration and current status, to
15       create and drop databases, and more.
16
17       Invoke mysqladmin like this:
18
19           shell> mysqladmin [options] command [command-arg] [command [command-arg]] ...
20
21       mysqladmin supports the following commands. Some of the commands take
22       an argument following the command name.
23
24       •   create db_name
25
26           Create a new database named db_name.
27
28       •   debug
29
30           Tell the server to write debug information to the error log.
31
32           This also includes information about the Event Scheduler.
33
34       •   drop db_name
35
36           Delete the database named db_name and all its tables.
37
38       •   extended-status
39
40           Display the server status variables and their values.
41
42       •   flush-all-statistics
43
44           Flush all statistics tables.
45
46       •   flush-all-status
47
48           Flush all status and statistics.
49
50       •   flush-binary-log
51
52           Flush the binary log.
53
54       •   flush-client-statistics
55
56           Flush client statistics.
57
58       •   flush-engine-log
59
60           Flush engine log.
61
62       •   flush-error-log
63
64           Flush error log.
65
66       •   flush-general-log
67
68           Flush general query log.
69
70       •   flush-hosts
71
72           Flush all information in the host cache.
73
74       •   flush-index-statistics
75
76           Flush index statistics.
77
78       •   flush-logs
79
80           Flush all logs.
81
82       •   flush-privileges
83
84           Reload the grant tables (same as reload).
85
86       •   flush-relay-log
87
88           Flush relay log.
89
90       •   flush-slow-log
91
92           Flush slow query log.
93
94       •   flush-status
95
96           Clear status variables.
97
98       •   flush-table-statistics
99
100           Flush table statistics.
101
102       •   flush-tables
103
104           Flush all tables.
105
106       •   flush-threads
107
108           Flush the thread cache.
109
110       •   flush-user-resources
111
112           Flush user resources.
113
114       •   kill id,id,...
115
116           Kill server threads. If multiple thread ID values are given, there
117           must be no spaces in the list.
118
119       •   old-password new-password
120
121           This is like the password command but stores the password using the
122           old (pre MySQL 4.1) password-hashing format.
123
124       •   password new-password
125
126           Set a new password. This changes the password to new-password for
127           the account that you use with mysqladmin for connecting to the
128           server. Thus, the next time you invoke mysqladmin (or any other
129           client program) using the same account, you will need to specify
130           the new password.
131
132           If the new-password value contains spaces or other characters that
133           are special to your command interpreter, you need to enclose it
134           within quotes. On Windows, be sure to use double quotes rather than
135           single quotes; single quotes are not stripped from the password,
136           but rather are interpreted as part of the password. For example:
137
138               shell> mysqladmin password "my new password"
139
140               Caution
141               Do not use this command used if the server was started with the
142               --skip-grant-tables option. No password change will be applied.
143               This is true even if you precede the password command with
144               flush-privileges on the same command line to re-enable the
145               grant tables because the flush operation occurs after you
146               connect. However, you can use mysqladmin flush-privileges to
147               re-enable the grant table and then use a separate mysqladmin
148               password command to change the password.
149
150       •   ping
151
152           Check whether the server is alive. The return status from
153           mysqladmin is 0 if the server is running, 1 if it is not. This is 0
154           even in case of an error such as Access denied, because this means
155           that the server is running but refused the connection, which is
156           different from the server not running.
157
158       •   processlist
159
160           Show a list of active server threads. This is like the output of
161           the SHOW PROCESSLIST statement. If the --verbose option is given,
162           the output is like that of SHOW FULL PROCESSLIST.
163
164       •   reload
165
166           Reload the grant tables.
167
168       •   refresh
169
170           Flush all tables and close and open log files.
171
172       •   shutdown
173
174           Stop the server.
175
176       •   start-all-slaves
177
178           Start all slaves.
179
180       •   start-slave
181
182           Start replication on a slave server.
183
184       •   status
185
186           Display a short server status message.
187
188       •   stop-all-slaves
189
190           Stop all slaves.
191
192       •   stop-slave
193
194           Stop replication on a slave server.
195
196       •   variables
197
198           Display the server system variables and their values.
199
200       •   version
201
202           Display version information from the server.
203
204       All commands can be shortened to any unique prefix. For example:
205
206           shell> mysqladmin proc stat
207           +----+-------+-----------+----+---------+------+-------+------------------+
208           | Id | User  | Host      | db | Command | Time | State | Info             |
209           +----+-------+-----------+----+---------+------+-------+------------------+
210           | 51 | monty | localhost |    | Query   | 0    |       | show processlist |
211           +----+-------+-----------+----+---------+------+-------+------------------+
212           Uptime: 1473624  Threads: 1  Questions: 39487
213           Slow queries: 0  Opens: 541  Flush tables: 1
214           Open tables: 19  Queries per second avg: 0.0268
215
216
217       The mysqladmin status command result displays the following values:
218
219       •   Uptime
220
221           The number of seconds the MariaDB server has been running.
222
223       •   Threads
224
225           The number of active threads (clients).
226
227       •   Questions
228
229           The number of questions (queries) from clients since the server was
230           started.
231
232       •   Slow queries
233
234           The number of queries that have taken more than long_query_time
235           seconds.
236
237       •   Opens
238
239           The number of tables the server has opened.
240
241       •   Flush tables
242
243           The number of flush-*, refresh, and reload commands the server has
244           executed.
245
246       •   Open tables
247
248           The number of tables that currently are open.
249
250       •   Memory in use
251
252           The amount of memory allocated directly by mysqld. This value is
253           displayed only when MariaDB has been compiled with
254           --with-debug=full.
255
256       •   Maximum memory used
257
258           The maximum amount of memory allocated directly by mysqld. This
259           value is displayed only when MariaDB has been compiled with
260           --with-debug=full.
261
262       If you execute mysqladmin shutdown when connecting to a local server
263       using a Unix socket file, mysqladmin waits until the server´s process
264       ID file has been removed, to ensure that the server has stopped
265       properly.
266
267       mysqladmin supports the following options, which can be specified on
268       the command line or in the [mysqladmin] and [client] option file
269       groups.
270
271--help, -?
272
273           Display help and exit.
274
275--character-sets-dir=path
276
277           The directory where character sets are installed.
278
279--compress, -C
280
281           Compress all information sent between the client and the server if
282           both support compression.
283
284--connect-timeout=timeout
285
286           Equivalent to --connect_timeout, see the end of this section.
287
288--count=N, -c N
289
290           The number of iterations to make for repeated command execution if
291           the --sleep option is given.
292
293--debug[=debug_options], -# [debug_options]
294
295           Write a debugging log. A typical debug_options string is
296           ´d:t:o,file_name´. The default is ´d:t:o,/tmp/mysqladmin.trace´.
297
298--debug-check
299
300           Check memory and open file usage at exit..
301
302--debug-info
303
304           Print debugging information and memory and CPU usage statistics
305           when the program exits.
306
307--default-auth
308
309           Default authentication client-side plugin to use.
310
311--default-character-set=charset_name
312
313           Use charset_name as the default character set.
314
315--defaults-extra-file=filename
316
317           Set filename as the file to read default options from after the
318           global defaults files has been read.  Must be given as first
319           option.
320
321--defaults-file=filename
322
323           Set filename as the file to read default options from, override
324           global defaults files. Must be given as first option.
325
326--force, -f
327
328           Do not ask for confirmation for the drop db_name command. With
329           multiple commands, continue even if an error occurs.
330
331--host=host_name, -h host_name
332
333           Connect to the MariaDB server on the given host.
334
335--local, -l
336
337           Suppress the SQL command(s) from being written to the binary log by
338           using FLUSH LOCAL or enabling sql_log_bin=0 for the session.
339
340--no-beep, -b
341
342           Suppress the warning beep that is emitted by default for errors
343           such as a failure to connect to the server.
344
345--no-defaults
346
347           Do not read default options from any option file. This must be
348           given as the first argument.
349
350--password[=password], -p[password]
351
352           The password to use when connecting to the server. If you use the
353           short option form (-p), you cannot have a space between the option
354           and the password. If you omit the password value following the
355           --password or -p option on the command line, mysqladmin prompts for
356           one.
357
358           Specifying a password on the command line should be considered
359           insecure.
360
361--pipe, -W
362
363           On Windows, connect to the server via a named pipe. This option
364           applies only if the server supports named-pipe connections.
365
366--port=port_num, -P port_num
367
368           The TCP/IP port number to use for the connection or 0 for default
369           to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services,
370           built-in default (3306).
371
372--print-defaults
373
374           Print the program argument list and exit. This must be given as the
375           first argument.
376
377--protocol={TCP|SOCKET|PIPE|MEMORY}
378
379           The connection protocol to use for connecting to the server. It is
380           useful when the other connection parameters normally would cause a
381           protocol to be used other than the one you want.
382
383--relative, -r
384
385           Show the difference between the current and previous values when
386           used with the --sleep option. Currently, this option works only
387           with the extended-status command.
388
389--shutdown-timeouttimeout
390
391           Equivalent of --shutdown_timeout, see the end of this section.
392
393--silent, -s
394
395           Exit silently if a connection to the server cannot be established.
396
397--sleep=delay, -i delay
398
399           Execute commands repeatedly, sleeping for delay seconds in between.
400           The --count option determines the number of iterations. If --count
401           is not given, mysqladmin executes commands indefinitely until
402           interrupted.
403
404--socket=path, -S path
405
406           For connections to localhost, the Unix socket file to use, or, on
407           Windows, the name of the named pipe to use.
408
409--ssl
410
411           Enable SSL for connection (automatically enabled with other flags).
412           Disable with --skip-ssl.
413
414--ssl-ca=name
415
416           CA file in PEM format (check OpenSSL docs, implies --ssl).
417
418--ssl-capath=name
419
420           CA directory (check OpenSSL docs, implies --ssl).
421
422--ssl-cert=name
423
424           X509 cert in PEM format (check OpenSSL docs, implies --ssl).
425
426--ssl-cipher=name
427
428           SSL cipher to use (check OpenSSL docs, implies --ssl).
429
430--ssl-key=name
431
432           X509 key in PEM format (check OpenSSL docs, implies --ssl).
433
434--ssl-crl=name
435
436           Certificate revocation list (check OpenSSL docs, implies --ssl).
437
438--ssl-crlpath=name
439
440           Certificate revocation list path (check OpenSSL docs, implies
441           --ssl).
442
443--ssl-verify-server-cert
444
445           Verify server's "Common Name" in its cert against hostname used
446           when connecting. This option is disabled by default.
447
448--tls-version=name,
449
450           Accepts a comma-separated list of TLS protocol versions. A TLS
451           protocol version will only be enabled if it is present in this
452           list. All other TLS protocol versions will not be permitted.
453
454--user=user_name, -u user_name
455
456           The MariaDB user name to use when connecting to the server.
457
458--verbose, -v
459
460           Verbose mode. Print more information about what the program does.
461
462--version, -V
463
464           Display version information and exit.
465
466--vertical, -E
467
468           Print output vertically. This is similar to --relative, but prints
469           output vertically.
470
471--wait[=count], -w[count]
472
473           If the connection cannot be established, wait and retry instead of
474           aborting. If a count value is given, it indicates the number of
475           times to retry. The default is one time.
476
477--wait-for-all-slaves
478
479           Wait for the last binlog event to be sent to all connected slaves
480           before shutting down.  This option is off by default.
481
482       You can also set the following variables by using --var_name=value
483
484       •   connect_timeout
485
486           The maximum number of seconds before connection timeout. The
487           default value is 43200 (12 hours).
488
489       •   shutdown_timeout
490
491           The maximum number of seconds to wait for server shutdown. The
492           default value is 3600 (1 hour).
493
495       Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.,
496       2010-2019 MariaDB Foundation
497
498       This documentation is free software; you can redistribute it and/or
499       modify it only under the terms of the GNU General Public License as
500       published by the Free Software Foundation; version 2 of the License.
501
502       This documentation is distributed in the hope that it will be useful,
503       but WITHOUT ANY WARRANTY; without even the implied warranty of
504       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
505       General Public License for more details.
506
507       You should have received a copy of the GNU General Public License along
508       with the program; if not, write to the Free Software Foundation, Inc.,
509       51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see
510       http://www.gnu.org/licenses/.
511
512

SEE ALSO

514       For more information, please refer to the MariaDB Knowledge Base,
515       available online at https://mariadb.com/kb/
516

AUTHOR

518       MariaDB Foundation (http://www.mariadb.org/).
519
520
521
522MariaDB 10.5                     27 June 2019                 MARIADB-ADMIN(1)
Impressum