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