MARIADB-ADMIN(1)
π MARIADB-ADMIN(1) β bestie, let's admin some databases π
okay so real quick, the manual name is MARIADB-ADMIN(1) and this is literally the client for administering a MariaDB server. also cute detail: mariadb-admin is now a symlink to mariadb-admin β yes, the manual says that, and no, we're not questioning it, we're just vibing. β¨
β¨ NAME β¨
mariadb-admin β a client for administering a MariaDB server (mariadb-admin is now a symlink to mariadb-admin). π«Ά
πΈ SYNOPSIS πΈ
mariadb-admin [options] command [command-arg] [command [command-arg]]
...
π DESCRIPTION π
so mariadb-admin is a client for performing administrative operations. you can use it to check the server's configuration and current status, to create and drop databases, and like, so much more. it's giving "one tool, all the chores." π
you invoke it like this, bestie:
shell> mariadb-admin [options] command [command-arg] [command [command-arg]] ...
mariadb-admin supports the commands below. some of them take an argument right after the command name β keep that in mind. π
π the commands π
create db_nameβ make a brand new database calleddb_name. new database, who dis.debugβ tell the server to write debug information to the error log. this also includes info about the Event Scheduler. the scheduler said "not me getting logged."drop db_nameβ delete the database nameddb_nameand all its tables. it's gone gone. πextended-statusβ display the server status variables and their values.flush-all-statisticsβ flush all statistics tables.flush-all-statusβ flush all status and statistics.flush-binary-logβ flush the binary log.flush-client-statisticsβ flush client statistics.flush-engine-logβ flush engine log.flush-error-logβ flush error log.flush-general-logβ flush general query log.flush-hostsβ flush all information in the host cache.flush-index-statisticsβ flush index statistics.flush-logsβ flush all logs.flush-privilegesβ reload the grant tables (same asreload).flush-relay-logβ flush relay log.flush-slow-logβ flush slow query log.flush-sslβ flush SSL certificates.flush-statusβ clear status variables.flush-table-statisticsβ flush table statistics.flush-tablesβ flush all tables.flush-threadsβ flush the thread cache.flush-user-resourcesβ flush user resources.kill id,id,...β kill server threads. if you're passing multiple thread ID values, there must be no spaces in the list. none. zero. nope.old-password new-passwordβ this is like thepasswordcommand but stores the password using the old (pre MySQL 4.1) password-hashing format. vintage-core, lowkey.password new-passwordβ set a new password. this changes the password to new-password for the account you use withmariadb-adminto connect to the server. so the next time you invokemariadb-admin(or literally any other client program) using that same account, you'll need to specify the new password. β¨
if the new-password value contains spaces or other characters that are special to your command interpreter, you need to wrap it in quotes. on Windows, be sure to use double quotes rather than single quotes β single quotes are not stripped from the password, they're interpreted as part of the password. ask us how we know. π for example:
shell> mariadb-admin password "my new password"
Caution β οΈ do not use this command if the server was started with the--skip-grant-tablesoption. no password change will be applied. this is true even if you precede thepasswordcommand withflush-privilegeson the same command line to re-enable the grant tables, because the flush operation occurs after you connect. however, you can usemariadb-admin flush-privilegesto re-enable the grant table and then use a separatemariadb-admin passwordcommand to change the password. two steps, one slay.
pingβ check whether the server is alive. the return status frommariadb-adminis0if the server is running,1if it is not. and it's0even in case of an error such asAccess denied, because that means the server is running but refused the connection, which is different from the server not running. she's alive, she's just being difficult. πprocesslistβ show a list of active server threads. this is like the output of theSHOW PROCESSLISTstatement. if the--verboseoption is given, the output is like that ofSHOW FULL PROCESSLIST.reloadβ reload the grant tables.refreshβ flush all tables and close and open log files.shutdownβ stop the server. bye bestie. πstart-all-slavesβ start all slaves.start-slaveβ start replication on a slave server.statusβ display a short server status message.stop-all-slavesβ stop all slaves.stop-slaveβ stop replication on a slave server.variablesβ display the server system variables and their values.versionβ display version information from the server.
all commands can be shortened to any unique prefix. periodt. for example:
shell> mariadb-admin proc stat
+----+-------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+-------+-----------+----+---------+------+-------+------------------+
| 51 | monty | localhost | | Query | 0 | | show processlist |
+----+-------+-----------+----+---------+------+-------+------------------+
Uptime: 1473624 Threads: 1 Questions: 39487
Slow queries: 0 Opens: 541 Flush tables: 1
Open tables: 19 Queries per second avg: 0.0268
π¦ what the status command is actually telling you π¦
the mariadb-admin status command result displays these values, and yes we're going through all of them:
- Uptime β the number of seconds the MariaDB server has been running.
- Threads β the number of active threads (clients).
- Questions β the number of questions (queries) from clients since the server was started.
- Slow queries β the number of queries that have taken more than
log_slow_query_timeseconds. - Opens β the number of tables the server has opened.
- Flush tables β the number of
flush-*,refresh, andreloadcommands the server has executed. - Open tables β the number of tables that currently are open.
- Memory in use β the amount of memory allocated directly by
mariadbd. this value is displayed only when MariaDB has been compiled with--with-debug=full. - Maximum memory used β the maximum amount of memory allocated directly by
mariadbd. this value is displayed only when MariaDB has been compiled with--with-debug=full.
if you execute mariadb-admin shutdown when connecting to a local server using a Unix socket file, mariadb-admin waits until the server's process ID file has been removed, to make sure the server has stopped properly. so patient. so responsible. π
π the options π
mariadb-admin supports the following options, which can be specified on the command line or in the [mariadb-admin] and [client] option file groups.
--help,-?β display help and exit.--character-sets-dir=pathβ the directory where character sets are installed.--compress,-Cβ compress all information sent between the client and the server, if both support compression.--connect-timeout=timeoutβ equivalent to--connect_timeout, see the end of this section.--count=N,-c Nβ the number of iterations to make for repeated command execution, if the--sleepoption is given.--debug[=debug_options],-# [debug_options]β write a debugging log. a typical debug_options string is'd:t:o,file_name'. the default is'd:t:o,/tmp/mariadb-admin.trace'.--debug-checkβ check memory and open file usage at exit.. (yes, the double period is in the original, we're keeping it, it's iconic π)--debug-infoβ print debugging information and memory and CPU usage statistics when the program exits.--default-authβ default authentication client-side plugin to use.--default-character-set=charset_nameβ use charset_name as the default character set.--defaults-extra-file=filenameβ set filename as the file to read default options from, after the global defaults files has been read. must be given as first option.--defaults-file=filenameβ set filename as the file to read default options from, override global defaults files. must be given as first option.--force,-fβ do not ask for confirmation for thedrop db_namecommand. with multiple commands, continue even if an error occurs.--host=host_name,-h host_nameβ connect to the MariaDB server on the given host.--local,-lβ suppress the SQL command(s) from being written to the binary log by usingFLUSH LOCALor enablingsql_log_bin=0for the session.--no-beep,-bβ suppress the warning beep that is emitted by default for errors such as a failure to connect to the server. beep begone. π--no-defaultsβ do not read default options from any option file. this must be given as the first argument.--password[=password],-p[password]β the password to use when connecting to the server. if you use the short option form (-p), you cannot have a space between the option and the password. if you omit the password value following the--passwordor-poption on the command line,mariadb-adminprompts for one.
specifying a password on the command line should be considered insecure. π₯
--pipe,-Wβ on Windows, connect to the server via a named pipe. this option applies only if the server supports named-pipe connections.--port=port_num,-P port_numβ the TCP/IP port number to use for the connection, or0for default to, in order of preference,my.cnf,$MYSQL_TCP_PORT,/etc/services, built-in default (3306). forces--protocol=tcpwhen specified on the command line without other connection properties.--print-defaultsβ print the program argument list and exit. this must be given as the first argument.--protocol={TCP|SOCKET|PIPE|MEMORY}β the connection protocol to use for connecting to the server. it's useful when the other connection parameters normally would cause a protocol to be used other than the one you want.--relative,-rβ show the difference between the current and previous values when used with the--sleepoption. currently, this option works only with theextended-statuscommand.--shutdown-timeouttimeout--shutdown_timeoutβ bestie this is literally the same thing as that option up there, pls see the end of this section π«--silent,-sβ if we can't even get a connection to the server, just dip. silently. no drama, no message, nothing πΈ--sleep=delay,-i delayβ runs the commands over and over, catching a lil nap for delay seconds in between each round π΄ the--countoption is what decides how many rounds you do. and if you never gave--count? thenmariadb-adminjust keeps going forever and ever until you interrupt it. no cap.--socket=path,-S pathβ when you're connecting to localhost, this is the Unix socket file to use π«Ά (or, on Windows, the name of the named pipe). Fun fact: if you put this on the command line all by itself with no other connection properties, it forces--protocol=socket; and on Windows it forces--protocol=pipe. iconic behavior tbh.--sslβ turn SSL on for the connection (it auto-enables itself when other flags are around too β¨). wanna turn it off?--skip-ssl.--ssl-ca=nameβ the CA file, in PEM format (go check the OpenSSL docs; this one implies--ssl).--ssl-capath=nameβ the CA directory (OpenSSL docs, bestie; implies--ssl).--ssl-cert=nameβ the X509 cert, PEM format (OpenSSL docs; implies--ssl).--ssl-cipher=nameβ which SSL cipher to use (OpenSSL docs; implies--ssl).--ssl-key=nameβ the X509 key, PEM format (OpenSSL docs; implies--ssl).--ssl-crl=nameβ certificate revocation list (OpenSSL docs; implies--ssl).--ssl-crlpath=nameβ certificate revocation list path (OpenSSL docs; implies--ssl).--ssl-verify-server-certβ checks the server's "Common Name" in its cert against the hostname you used when connecting π and heads up: this one is disabled by default.--tls-version=name,β takes a comma-separated list of TLS protocol versions. a TLS protocol version only gets enabled if it's in this list β every other TLS protocol version is simply not permitted, periodt π«--user=user_name,-u user_nameβ the MariaDB user name to use when connecting to the server π--verbose,-vβ verbose mode, bestie. it prints more info about what the program is actually doing π--version,-Vβ shows the version info and exits. bye π--vertical,-Eβ prints the output vertically. it's giving--relative, but vertical π--wait[=count],-w[count]β if the connection can't be established, wait and retry instead of just aborting π«Ά and if you hand it a count value, that's how many times it retries. the default is one time.--wait-for-all-slavesβ waits for the last binlog event to be sent to all the connected slaves before shutting down. this option is off by default β
π§ the vars you can also set (yes really)
You can also set the following variables by using --var_name=value
connect_timeoutβ the max number of seconds before the connection times out. the default value is43200(that's 12 hours, girl π).shutdown_timeoutβ the max number of seconds to wait for the server to shut down. the default value is3600(that's 1 hour β°).
π COPYRIGHT
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2025 MariaDB Foundation
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/.
π SEE ALSO
For more information, please refer to the MariaDB Documentation, available online at https://mariadb.com/docs/
π AUTHOR
MariaDB Foundation (http://www.mariadb.org/).
okay that's the whole page bestie, you ate that π this was MariaDB 11.8, dated 5 March 2025 β go be the main character of your own database now π¦β¨
π¦ where this page comes from
- alpine 3.24: mariadb-doc 11.8.9-r0 Β· GPL-2.0-only
- arch rolling: mariadb-clients 13.0.2-2 Β· GPL-2.0-only
- arch rolling: mariadb-lts-clients 12.3.3-2 Β· GPL-2.0-only
- centos-stream 10: mariadb11.8 3:11.8.8-1.el10 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- centos-stream 9: mariadb 3:11.8.8-1.module_el9+1370+ec5ecc2e Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- debian trixie: mariadb-client 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- fedora 43: mariadb11.8 3:11.8.8-1.fc43 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 43: mariadb12.3 3:12.3.2-2.fc43 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 44: mariadb 3:11.8.6-2.fc44 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 44: mariadb 3:11.8.8-3.fc44 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 44: mariadb12.3 3:12.3.2-2.fc44 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- nixpkgs unstable: mariadb-server 11.8.8
- opensuse-leap 16.0: mariadb-client 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- opensuse-leap 16.0: mariadb-client 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- opensuse-leap 16.0: mariadb-client 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- opensuse-leap 16.0: mariadb-client 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- ubuntu resolute: mariadb-client 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: mariadb-client 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: mariadb-client 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms