All pages
Powered by GitBook
1 of 18

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Administrative Tools

Explore administrative tools. This section introduces various command line utilities and graphical interfaces designed to help you manage, monitor, and configure your database efficiently.

dbdeployer

dbdeployer is a tool for installing multiple versions of MariaDB or MySQL in isolation from each other. It is primarily used for easily testing different server versions. It is written in Go, and is a replacement for MySQL Sandbox.

Visit www.dbdeployer.com for details on how to install and use it.

This page is licensed: CC BY-SA / Gnu FDL

innochecksum

innochecksum is a tool for printing checksums for InnoDB files.

Usage

Description

The tool reads an tablespace file, calculates the checksum for each page, compares the calculated checksum to the stored checksum, and reports mismatches, which indicate damaged pages. It was originally developed to speed up verifying the integrity of tablespace files after power outages, but can also be used after file copies. Because checksum mismatches causes InnoDB to deliberately shut down a running server, it can be preferable to use innochecksum rather than waiting for a server in production usage to encounter damaged pages.

Multiple filenames can be specified by a wildcard (on non-Windows systems only).

innochecksum works with compressed pages, and includes options to analyze leaf pages to estimate how fragmented an index is and how much benefit can be gained from defragmentation.

innochecksum cannot be used on tablespace files that the server already has open. For such files, you should use CHECK TABLE to check tables within the tablespace. If checksum mismatches are found, you would normally restore the tablespace from backup or start the server and attempt to use mariadb-dump to make a backup of the tables within the tablespace.

Options

innochecksum supports the following options. For options that refer to page numbers, the numbers are zero-based.

Option
Description

-a, --allow-mismatches=#

Maximum checksum mismatch allowed before innochecksum terminates. Defaults to 0, which terminates on the first mismatch.

-c, --count

Print a count of the number of pages in the file.

-e num, --end-page=#

End at this page number (0-based).

-?, --help

Display help and exits.

-I, --info

Synonym for --help.

-f, --leaf

Examine leaf index pages.

Examples

Rewriting a CRC32 checksum to replace an invalid checksum:

A count of each page type:

This page is licensed: CC BY-SA / Gnu FDL

InnoDB
innochecksum [options] file_name
innochecksum --no-check --write crc32 tablename.ibd
innochecksum --page-type-summary data/mysql/gtid_slave_pos.ibd

File::data/mysql/gtid_slave_pos.ibd
================PAGE TYPE SUMMARY==============
#PAGE_COUNT	PAGE_TYPE
===============================================
       1	Index page
       0	Undo log page
       1	Inode page
       0	Insert buffer free list page
       2	Freshly allocated page
       1	Insert buffer bitmap
       0	System page
       0	Transaction system page
       1	File Space Header
       0	Extent descriptor page
       0	BLOB page
       0	Compressed BLOB page
       0	Page compressed page
       0	Page compressed encrypted page
       0	Other type of page

===============================================
Additional information:
Undo page type: 0 insert, 0 update, 0 other
Undo page state: 0 active, 0 cached, 0 to_free, 0 to_purge, 0 prepared, 0 other
index_id	#pages		#leaf_pages	#recs_per_page	#bytes_per_page
24		1		1		0		0

index_id	page_data_bytes_histgram(empty,...,oversized)
24		1	0	0	0	0	0	0	0	0	0	0	0

-l fn, --log=fn

Log output to the specified filename fn.

-m num, --merge=#

Leaf page count, in case of a merge, given number of consecutive pages.

-n, --no-check

Ignore the checksum verification. Before MariaDB 10.6, must be used with the --write option.

-p num, --page=#

Check only this page number (0-based).

-D, --page-type-dump=name

Dump the page type info for each page in a tablespace.

-S, --page-type-summary

Display a count of each page type in a tablespace.

-i, --per-page-details

Print out detailed information per page.

-u, --skip-corrupt

Skip corrupt pages.

-r, --skip-freed-pages

innochecksum misinterprets freed pages as active, leading to confusion that too many valid pages exist. To avoid this, this option was introduced to avoid freed pages while dumping or printing the summary of the tablespace.

This option is available from MariaDB 11.7.2, 11.4.5, 10.6.21, and 10.11.11.

-s num, --start-page=#

Start at this page number (0-based).

-C, --strict-check=name

Specify the strict checksum algorithm. One of: crc32, innodb, none. If not specified, validates against innodb, crc32 , and none. full_crc32 is not supported. See also innodb_checksum_algorithm.

This option was removed in MariaDB 10.6.0.

-v, --verbose

Verbose mode; print a progress indicator every five seconds.

-V, --version

Display version information and exit.

-w, --write=name

Rewrite the checksum algorithm. One of crc32, innodb, none. An exclusive lock is obtained during use. Use in conjunction with the -no-check option to rewrite an invalid checksum.

This option was removed in MariaDB 10.6.0.

mariadb-tzinfo-to-sql

mariadb-tzinfo-to-sql is a tool used to load on systems that have a zoneinfo database to load the time zone tables (, , , and ) into the mysql database.

Previously, the client was called mysql_tzinfo_to_sql. It can still be accessed under this name, via a symlink in Linux, or an alternate binary in Windows.

Most Linux, Mac OS X, FreeBSD and Solaris systems will have a zoneinfo database - Windows does not. The database is commonly found in the /usr/share/zoneinfo directory, or, on Solaris, the /usr/share/lib/zoneinfo directory.

Usage

mariadb-tzinfo-to-sql can be called in several ways. The output is usually passed straight to the mariadb client for direct loading in the mysql database.

Resetting timezone tables

If there is a need to reset the timezone to the default, to before using mariadb-tzinfo-to-sql, one can do that by executing:

The old timezone values is in effect until the server is restarted.

Examples

Most commonly, the whole directory is passed:

Load a single time zone file, timezone_file, corresponding to the time zone called timezone_name :

A separate command for each time zone and time zone file the server needs is required.

To account for leap seconds, use:

After populating the time zone tables, you should usually restart the server so that the new time zone data are correctly loaded.

This page is licensed: CC BY-SA / Gnu FDL

time zones
time_zone
time_zone_leap_second
time_zone_name
time_zone_transition
time_zone_transition_type
shell> mariadb-tzinfo-to-sql timezone_dir
shell> mariadb-tzinfo-to-sql timezone_file timezone_name
shell> mariadb-tzinfo-to-sql --leap timezone_file
TRUNCATE TABLE mysql.time_zone;
TRUNCATE TABLE mysql.time_zone_name;
TRUNCATE TABLE mysql.time_zone_transition;
TRUNCATE TABLE mysql.time_zone_transition_type;
TRUNCATE TABLE mysql.time_zone_leap_second;
shell> mariadb-tzinfo-to-sql /usr/share/zoneinfo | mariadb -u root mysql
shell> mariadb-tzinfo-to-sql timezone_file timezone_name | mariadb -u root mysql
shell> mariadb-tzinfo-to-sql --leap timezone_file | mariadb -u root mysql

mariadb-conv

This tool is available from MariaDB 10.5.

mariadb-conv is a character set conversion utility for MariaDB.

Usage

Options

mariadb-conv supports the following options:

Option
Description

By default, mariadb-conv exits whenever it encounters any conversion problems, like

  • the input byte sequence is not valid in the source character set;

  • the character cannot be converted to the target character set.

The -c option makes mariadb-conv ignore such errors and use the question mark (?) to replace bytes in bad input sequences, or unconvertible characters.

The --delimiter=... option makes mariadb-conv treat the specified characters as delimiters rather than data to convert, so the input is treated as a combination of

  • data chunks, which are converted according to the -f and -t options;

  • delimiters, which are not converted and are copied from the input to the output as is.

Examples

Convert the file file.latin1.txt from latin1 to utf8 :

Convert the file file.latin1.txt from latin1 to utf8, reading the input data from stdin:

Using mariadb-conv in a pipe:

As a side effect, mariadb-conv can be used to list MariaDB data directories in a human readable form. Suppose you create the following tables:

This statement creates the following files in the MariaDB data directory:

It's not precisely clear which file stores which table, because MariaDB uses a special table-name-to-file-name encoding.

This command on Linux (assuming an utf-8 console) can print the table list in a readable way:

The --delimiter=".\n" option is needed to make mariadb-conv treat the dot character (delimiting the encoded table name from the file extension) and the newline character (delimiting separate lines) as delimiters, rather than as the data to convert (otherwise the conversion would fail).

Windows users can use the following command to list the data directory in the ANSI text console:

Note:

  • The -t options assume a Western machine.

  • The -c option is needed to ignore conversion errors for Cyrillic and CJK characters.

  • --delimiter= additionally needs the carriage return character.

This page is licensed: CC BY-SA / Gnu FDL

replace

Description

The replace utility program changes strings in place in files or on the standard input. Invoke replace in one of the following ways:

from represents a string to look for, and to represents its replacement. There can be one or more pairs of strings.

A from-string can contain these special characters:

Character
Description

Use the -- option to indicate where the string-replacement list ends and the file names begin. Any file named on the command line is modified in place, so you may want to make a copy of the original before converting it. replace prints a message indicating which of the input files it actually modifies.

If the -- option is not given, replace reads standard input and writes to stdout (standard output).

replace uses a finite state machine to match longer strings first. It can be used to swap strings. For example, the following command swaps "a" and "b" in the given files, file1 and file2:

Options

replace supports the following options:

Option
Description

This page is licensed: CC BY-SA / Gnu FDL

mariadb-setpermission

Syntax

Description

mariadb-setpermission is a Perl script that was originally written and contributed by Luuk de Boer. It requires the DBI and DBD::mysql Perl modules to be installed.mariadb-setpermission can help you add users or databases or change passwords in MariaDB.

It interactively sets permissions in the MariaDB grant tables, but does not check permissions which have already been set in MariaDB. So if you can't connect to MariaDB using the permission you just added, take a look at the permissions which have already been set in MariaDB.

The account used when you connect determines which permissions you have when attempting to modify existing permissions in the grant tables.

mariadb-setpermission also reads options from the [client] and [perl] groups in the .my.cnf file in your home directory, if the file exists.

The following options are available:

Options

Example

This page is licensed: CC BY-SA / Gnu FDL

my_print_defaults

my_print_defaults displays the options from option groups of option files. It is useful to see which options a particular tool will use.

Output is one option per line, displayed in the form in which they would be specified on the command line.

Usage

my_print_defaults [OPTIONS] [groups]

Options

Option
Description

Examples

reads from the [mariadb-check] and [client] sections in , so the following would display the mariadb-check options.

This page is licensed: CC BY-SA / Gnu FDL

mariadb-find-rows

mariadb-find-rows reads files containing SQL statements and extracts statements that match a given regular expression or that contain USE db_name or SET statements.

Previously, the client was called mysql_find_rows. It can still be accessed under this name, via a symlink in Linux, or an alternate binary in Windows.

The utility was written for use with update log files (as used prior to MySQL 5.0), and as such expects statements to be terminated with semicolon (;) characters. It may be useful with other files that contain SQL statements, as long as statements are terminated with semicolons.

Usage

Each file_name argument should be the name of file containing SQL statements. If no file names are given, the tool reads from stdin (standard input).

Options

mariadb-find-rows supports the following options:

Option
Description

Examples

This page is licensed: CC BY-SA / Gnu FDL

perror

perror is a utility that displays descriptions for system or storage engine error codes.

See MariaDB Error Codes for a full list of MariaDB error codes, and Operating System Error Codes for a list of Linux and Windows error codes.

Usage

perror [OPTIONS] [ERRORCODE [ERRORCODE...]]

If you need to describe a negative error code, use -- before the first error code to end the options.

Options

Option
Description

Examples

System error code:

MariaDB/MySQL error code:

This page is licensed: CC BY-SA / Gnu FDL

mariadb-plugin

mariadb-plugin is a tool for enabling or disabling .

The client was previously called mysql_plugin, and can still be accessed under this name, via a symlink in Linux, or an alternate binary in Windows.

It is a command line alternative to the and statements, and the --plugin-load option to .

mariadb-plugin must be run while the server is offline, and works by adding or removing rows from the table.

mariadb-plugin basically has two use cases:

mariadb-conv [OPTION...] [FILE...]
shell> replace from to [from to] ... -- file_name [file_name] ...
shell> replace from to [from to] ... < file_name
mariadb-setpermission [options]

--mariadbd

Read the same set of groups that the server does. Available from MariaDB 10.11.3.

--mysqld

Read the same set of groups that the server does.

-n, --no-defaults

Return an empty string (useful for scripts).

?, --help

Display this help message and exit.

-v, --verbose

Increase the output level.

-V, --version

Output version information and exit.

-c, --config-file=name

Deprecated, use --defaults-file instead. Name of config file to read; if no extension is given, default extension (.ini or .cnf) are added.

-d, --debug[=#]

In debug versions, write a debugging log. A typical debug_options string is d:t:o,file_name. The default is d:t:o,/tmp/my_print_defaults.trace.

-c, --defaults-file=name

Like --config-file, except if it is the first option. In that case, read this file only, do not read global or per-user config files; should be the first option. Removed in MariaDB 10.8.

-e, --defaults-extra-file=name

Read this file after the global config file and before the config file in the users home directory; should be the first option. Removed in MariaDB 10.8.

-g, --defaults-group-suffix=name

In addition to the given groups, read also groups with this suffix. Removed in MariaDB 10.8.

-e, --extra-file=name

Deprecated. Synonym for --defaults-extra-file.

mariadb-check
option files

To add a plugin even before the first real server startup.

  • To remove a plugin that crashes the server on startup.

  • For the installation use case, adding a plugin-load-add entry to my.cnf or in a separate include option file is a better alternative. In case of a plugin loaded via a mysql.plugin crashing the server, uninstalling the plugin with the help of mariadb-plugin can be the only viable action, though.

    Usage

    mariadb-plugin expects to find a configuration file that indicates how to configure the plugins. The configuration file has, by default, the same name as the plugin, with an .ini extension:

    Here, mariadb-plugin looks for a file called crazyplugins.ini :

    The first line should contain the name of the library object file, with no extension. The other lines list the names of the components. Each value should be on a separate line. The # character at the start of a line indicates a comment.

    Options

    The following options can be specified on the command line, while some can be specified in the [mysqld] group of any option file. For options specified in a [mysqld] group, only the --basedir, --datadir, and --plugin-dir options can be used — the rest are ignored.

    Option
    Description

    -b, --basedir=name

    The base directory for the server.

    -d, --datadir=name

    The data directory for the server.

    -?, --help

    Display help and exit.

    -f, --my-print-defaults=name

    Path to my_print_defaults executable. Example: /source/temp11/extra

    -m, --mysqld=name

    Path to mysqld executable. Example: /sbin/temp1/mysql/bin

    -n, --no-defaults

    Do not read values from configuration file.

    See Also

    • List of Plugins

    • Plugin Overview

    • INFORMATION_SCHEMA.PLUGINS Table

    • INSTALL PLUGIN

    This page is licensed: CC BY-SA / Gnu FDL

    plugins
    INSTALL PLUGIN
    UNINSTALL PLUGIN
    mariadbd
    mysql.plugin

    -f, --from=name

    Specifies the encoding of the input.

    -t, --to=name

    Specifies the encoding of the output.

    -c, --continue

    Silently ignore conversion errors.

    --delimiter=name

    Treat the specified characters as delimiters.

    ^

    Match start of line.

    $

    Match end of line.

    \b

    Match space-character, start of line or end of line. For an end \b , the next replace starts looking at the end space character ( ). A \b alone in a string matches only a space character.

    -?, -I

    Display a help message and exit.

    -#debug_options

    Enable debugging.

    -s

    Silent mode. Print less information about what the program does.

    -v

    Verbose mode. Print more information about what the program does.

    -V

    Display version information and exit.

    --help

    Display a help message and exit.

    --host=host_name

    Connect to the MariaDB server on the given host.

    --password=password

    The password to use when connecting to the server. Note that the password value is not optional for this option, unlike for other MariaDB programs Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line.

    --port=port_num

    The TCP/IP port number to use for the connection.

    --socket=path

    For connections to localhost, the Unix socket file to use.

    --user=user_name

    The MariaDB user name to use when connecting to the server.

    --help, --Information

    Display help and exit.

    --regexp=pattern

    Display queries that match pattern.

    --rows=N

    Quit after displaying N queries.

    --skip-use-db

    Do not include USE db_name statements in the output.

    --start_row=N

    Start output from this row (first row is 1).

    -?, --help

    Display help and exit.

    -I, --info

    Synonym for --help.

    -s, --silent

    Only print the error message.

    -v, --verbose

    Print error code and message (default). (Defaults to on; use --skip-verbose to disable.)

    -V, --version

    Displays version information and exits.

    mariadb-report

    mariadb-report makes a friendly report of important MariaDB status values.

    Previously, the client was called mysqlreport. It can still be accessed under this name, via a symlink in Linux, or an alternate binary in Windows.

    mariadb-report makes a report of nearly every status value from SHOW STATUS. Unlike SHOW STATUS , which simply dumps over 100 values to the screen in one long list, mariadb-report interprets and formats the values, and presents the basic values and many more inferred values in a human-readable format. Numerous example reports are available in this report: hackmysql.com/mysqlreport, archived here.

    The benefit of mariadb-report is that it allows you to very quickly see a wide array of performance indicators for your MariaDB server which would otherwise need to be calculated by hand from all the various SHOW STATUS values. For example, the Index Read Ratio is an important value but it's not present in SHOW STATUS; it's an inferred value (the ratio of Key_reads to Key_read_requests).

    This documentation outlines all the command line options in mariadb-report, most of which control which reports are printed. This document does not address how to interpret these reports; that topic is covered in the document Guide To Understanding mysqlreport, .

    Usage

    mariadb-report options

    Technically, command line options are in the form --option, but -option works, too. All options can be abbreviated if the abbreviation is unique. For example, option --host can be abbreviated to --ho but not --h because --h is ambiguous: it could mean --host or --help.

    Option
    Description

    This page is licensed: CC BY-SA / Gnu FDL

    mariadb-embedded

    mariadb-embedded is a [mariadb client](../mariadb-client/mariadb-command line-client.md), statically linked to libmariadbd, the embedded server.

    Previously, the client was called mysql_embedded. It can still be accessed under this name, via a symlink in Linux, or an alternate binary in Windows.

    Upon execution, an embedded MariaDB server is instantiated, and you can execute statements just as you would using the normal mariadb client, using the same options.

    Do not run mariadb-embedded using the same database as a running MariaDB server!

    my_print_defaults --defaults-file=example.cnf client client-server mysql
    my_print_defaults mariadb-check client
    mariadb-plugin [options] <plugin> ENABLE|DISABLE
    mariadb-plugin crazyplugins ENABLE
    crazyplugins
    crazyplugin1
    crazyplugin2
    crazyplugin3
    mariadb-conv -f latin1 -t utf8 file.latin1.txt
    mariadb-conv -f latin1 -t utf8 < file.latin1.txt
    echo test | ./mariadb-conv -f utf8 -t ucs2 >file.ucs2.txt
    SET NAMES utf8;
    CREATE OR REPLACE TABLE t1 (a INT);
    CREATE OR REPLACE TABLE ß (a INT);
    CREATE OR REPLACE TABLE абв (a INT);
    CREATE OR REPLACE TABLE 桌子 (a INT);
    @1j.frm
    @1j.ibd
    @684c@5b50.frm
    @684c@5b50.ibd
    @g0@h0@i0.frm
    @g0@h0@i0.ibd
    t1.frm
    t1.ibd
    ls | mariadb-conv -f filename -t utf8 --delimiter=".\n"
    
    ß.frm
    ß.ibd
    桌子.frm
    桌子.ibd
    абв.frm
    абв.ibd
    t1.frm
    t1.ibd
    dir /b | mariadb-conv -c -f filename -t cp850 --delimiter=".\r\n"
    shell> replace a b b a -- file1 file2 ...
    ./mariadb-setpermission --user=msandbox --password=msandbox --host=127.0.0.1 --port=11200
    ######################################################################
    ## Welcome to the permission setter 1.4 for MariaDB.
    ## made by Luuk de Boer
    ######################################################################
    What would you like to do:
      1. Set password for an existing user.
      2. Create a database + user privilege for that database
         and host combination (user can only do SELECT)
      3. Create/append user privilege for an existing database
         and host combination (user can only do SELECT)
      4. Create/append broader user privileges for an existing
         database and host combination
         (user can do SELECT,INSERT,UPDATE,DELETE)
      5. Create/append quite extended user privileges for an
         existing database and host combination (user can do
         SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,
         LOCK TABLES,CREATE TEMPORARY TABLES)
      6. Create/append full privileges for an existing database
         and host combination (user has FULL privilege)
      7. Remove all privileges for an existing database and
         host combination.
         (user will have all permission fields set to N)
      0. exit this program
    mariadb-find-rows [options] [file_name ...]
    mariadb-find-rows --regexp=problem_table --rows=20 < update.log
    mariadb-find-rows --regexp=problem_table  update-log.1 update-log.2
    shell> perror 96
    OS error code  96:  Protocol family not supported
    shell> perror 1005 1006
    MySQL error code 1005 (ER_CANT_CREATE_TABLE): Can't create table %`s.%`s (errno: %M)
    MySQL error code 1006 (ER_CANT_CREATE_DB): Can't create database '%-.192s' (errno: %M)
    shell> perror --silent 1979
    You are not owner of query %lu

    --help

    Output help information and exit.

    --host ADDRESS

    Host address.

    --infile file

    Instead of getting values from MariaDB, read values from file. file is often a copy of the output of SHOW STATUS including formatting characters (+, -). mariadb-report expects file to have the format "value number", where value is only alpha and underscore characters (A-Z and _) and number is a positive integer. Anything before, between, or after value and number is ignored. mariadb-report also needs the following MariaDB server variables: , , , , . These values can be specified in INFILE in the format "name = value", where name is one of the aforementioned server variables and value is a positive integer with or without a trailing M and possible periods (for version). For example, to specify an 18M key_buffer_size, specify key_buffer_size = 18M. Or, for a 256 byte table_cache, specify table_cache = 256. The M implies Megabytes, so 18M means 18,874,368. If these server variables are not specified, the following defaults are used (respectively) which may cause strange values to be reported: 0.0.0, 64, 100, 8M, 0.

    --no-mycnf

    Makes mariadb-report not read /.my.cnf which it does by default otherwise. --user and --password always override values from /.my.cnf.

    --outfile file

    After printing the report to screen, print the report to file too. Internally, mariadb-report always writes the report to a temporary file first: /tmp/mysqlreport.PID on *nix, c:sqlreport. PID on Windows (PID is the script's process ID). Then it prints the temp file to screen. Then if --outfile is specified, the temp file is copied to OUTFILE. After --email (above), the temp file is deleted.

    --password

    --password can take the password on the command line, like --password FOO. Using --password without an argument causes mariadb-report to prompt for a password.

    --port port

    Port number.

    --qcache

    Print report.

    --sas

    Print report for Select_ and Sort_ (after Questions report). See MySQL Select and Sort Status Variables, archived .

    --socket socket

    For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.

    --tab

    Print Threads, Aborted, and Bytes status reports (after Created temp report). The Threads report reports on all Threads_ status values.

    --user username

    Username.

    --all

    Equivalent to --dtq --dms --com 3 --sas --qcache. (Note that --tab is not invoked by --all.)

    --com N

    Print top N number of non-DMS Com_ status values in descending order (after DMS in Questions report). If N is not given, default is 3. Such non-DMS Com_ values include Com_change_db, Com_show_tables, Com_rollback, etc.

    --dms

    Print Data Manipulation Statements (DMS) report (under DMS in Questions report). DMS are those from the Data Manipulation section. mariadb-report considers only SELECT, INSERT, REPLACE, UPDATE, and DELETE. Each DMS is listed in descending order by count.

    --dtq

    Print Distribution of Total Queries (DTQ) report (under Total in Questions report). Queries (or Questions) can be divided into four main areas: DMS (see --dms), Com_ (see --com ), COM_QUIT (see COM_QUIT and Questions, archived here), and Unknown. --dtq lists the number of queries in each of these areas in descending order.

    --email address

    After printing the report to screen, email the report to address. This option requires sendmail in /usr/sbin/, therefore it does not work on Windows. /usr/sbin/sendmail can be a symlink to qmail, or any MTA (mail transfer agent) that emulates sendmail's -t command line option and operation. The FROM: field is "mariadb-report", SUBJECT: is "MySQL status report".

    --flush-status

    Execute a FLUSH STATUS after generating the reports. If you do not have permissions in MariaDB to do this an error from DBD::mysql::st is printed after the reports.

    archived here
    Examples

    Sending options with --server-arg:

    This page is licensed: CC BY-SA / Gnu FDL

    sudo mariadb-embedded -e 'select user, host, password from mysql.user where user="root"'
    +------+-----------+-------------------------------------------+
    | user | host      | password                                  |
    +------+-----------+-------------------------------------------+
    | root | localhost | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 |
    | root | db1       | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 |
    | root | 127.0.0.1 | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 |
    | root | ::1       | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 |
    +------+-----------+-------------------------------------------+
    sudo mariadb-embedded --server-arg='--skip-innodb'
      --server-arg='--default-storage-engine=myisam' 
      --server-arg='--log-error=/tmp/mysql.err' 
      -e 'select user, host, password from mysql.user where user="root"'
    +------+-----------+-------------------------------------------+
    | user | host      | password                                  |
    +------+-----------+-------------------------------------------+
    | root | localhost | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 |
    | root | db1       | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 |
    | root | 127.0.0.1 | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 |
    | root | ::1       | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 |
    +------+-----------+-------------------------------------------+

    -p, --plugin-dir=name

    The plugin directory for the server.

    -i, --plugin-ini=name

    Read plugin information from configuration file specified instead of from /<plugin_name>.ini.

    -P, --print-defaults

    Show default values from configuration file.

    -v, --verbose

    More verbose output; you can use this multiple times to get even more verbose output.

    -V, --version

    Output version information and exit.

    INSTALL SONAME
    UNINSTALL PLUGIN
    UNINSTALL SONAME
    mariadbd
    mysqld

    mariadb-access

    mariadb-access is a tool for checking access privileges, developed by Yves Carlier.

    The client tool can alternatively be called by its former name, mysqlaccess, via a symlink in Linux, or an alternate binary in Windows.

    The client tool is called mysqlaccess.

    It checks the access privileges for a host name, user name, and database combination.

    mariadb-access checks access using only the , , and host tables. It does not check table, column, or routine privileges specified in the , , or tables.

    Usage

    If your MariaDB distribution is installed in some non-standard location, you must change the location where mariadb-access expects to find the mariadb client. Edit the mariadb-access script at approximately line 18. Search for a line that looks like this:

    Change the path to reflect the location where the mariadb client tool is stored on your system. Otherwise, a Broken pipe error occurs when running mariadb-access.

    Options

    Option
    Description

    Note

    At least the user (-u) and the database (-d) options must be given, even when using wildcards. If no host is provided, `localhost' is assumed. Wildcards (?, %, and _) are allowed for host, user, and database, but be sure to escape them from your shell.

    This page is licensed: CC BY-SA / Gnu FDL

    mariadb-waitpid

    mariadb_waitpid is a utility for terminating processes.

    It runs on Unix-like systems, making use of the kill() system call.

    Previously, the client was called mysql_waitpid. It can still be accessed under this name, via a symlink in Linux, or an alternate binary in Windows.

    Usage

    Description

    mariadb-waitpid sends signal 0 to the process pid and waits up to time seconds for the process to terminate. pid. time must be positive integers.

    Returns 0 if the process terminates in time or does not exist, and 1 otherwise.

    Signal 1 is used if the kill() system call cannot handle signal 0.

    Options

    Option
    Description

    This page is licensed: CC BY-SA / Gnu FDL

    mariadb-report [options]

    -U username, --superuser=username

    Connect as superuser.

    -P password, --spassword=password

    Password for superuser.

    -H server, --rhost=server

    Remote server to connect to.

    --old_server

    Connect to a very old MySQL servers (before version 3.21) that does not know how to handle full WHERE clauses.

    -b, --brief

    Single-line tabular report.

    -t, --table

    Report in table-format.

    --relnotes

    Print release-notes.

    --plan

    Print suggestions/ideas for future releases.

    --howto

    Some examples of how to run `mariadb-access'.

    --debug=N

    Enter debug level N (0..3).

    --copy

    Reload temporary grant tables from original ones.

    --preview

    Show differences in privileges after making changes in (temporary) grant tables.

    --commit

    Copy grant rules from temporary tables to grant tables (the grant tables must be flushed afterwards, for example with ).

    --rollback

    Undo the last changes to the grant tables.

    -?, --help

    Display help and exit.

    -v, --version

    Display version.

    -u username, --user=username

    Username for logging in to the server.

    -p[password], --password[=password]

    Password to use for user. If omitted, mariadb-access prompts for one.

    -h hostname, --host=hostname

    Name or IP of the host.

    -d dbname, --db=dbname

    Name of the database.

    user
    db
    tables_priv
    columns_priv
    procs_priv

    -?, --help

    Display help and exit.

    -I, --help

    Synonym for -?.

    -v, --verbose

    Be more verbose. Give a warning, if kill can't handle signal 0.

    -V, --version

    Print version information and exit.

    SHOW STATUS
    version
    table_cache
    max_connections
    key_buffer_size
    query_cache_size
    Query Cache
    status values
    here

    resolve_stack_dump

    resolve_stack_dump is a tool that resolves numeric stack strace dumps into symbols.

    Usage

    resolve_stack_dump [OPTIONS] symbols-file [numeric-dump-file]

    The symbols-file should include the output from: nm --numeric-sort mariadbd. The numeric-dump-file should contain a numeric stack trace from mariadbd. If the numeric-dump-file is not given, the stack trace is read from stdin.

    Options

    Option
    Description

    This page is licensed: CC BY-SA / Gnu FDL

    mariadb-access [host [user [db]]] OPTIONS
    $MYSQL = ´/usr/local/bin/mariadb;
    path to mariadb executable
    mariadb-waitpid [options] pid time

    -h, --help

    Display this help and exit.

    -V, --version

    Output version information and exit.

    -s, --symbols-file=name

    Use specified symbols file.

    -n, --numeric-dump-file=name

    Read the dump from specified file.

    mariadb-admin reload

    mariadb-show

    Shows the structure of a MariaDB database (databases, tables, columns and indexes).

    To get similar functionality, you can use SHOW DATABASES, SHOW TABLES, SHOW COLUMNS, SHOW INDEX and SHOW TABLE STATUS, as well as the Information Schema tables (TABLES, COLUMNS, STATISTICS).

    Usage

    The output displays only the names of those databases, tables, or columns for which you have some privileges.

    If no database is given then all matching databases are shown. If no table is given, then all matching tables in database are shown. If no column is given, then all matching columns and column types in table are shown.

    If the last argument contains a shell or SQL wildcard (*, ?, % , or _), only what's matched by the wildcard is shown. If a database name contains any underscores, those should be escaped with a backslash (some Unix shells require two) to get a list of the proper tables or columns. The * and ? characters are converted into SQL % and _ wildcard characters. This might cause some confusion when trying to display the columns for a table whose name contains an underscore character (_), because mariadb-show shows only the table names that match the pattern. To fix this, add an extra % last on the command line, as a separate argument.

    Options

    mariadb-show supports the following options:

    Option
    Description

    Option Files

    In addition to reading options from the command line, mariadb-show can also read options from . If an unknown option is provided to mariadb-show in an option file, then it is ignored.

    The following options relate to how MariaDB command line tools handles option files. They must be given as the first argument on the command line:

    Option
    Description

    mariadb-show is linked with . However, MariaDB Connector/C does not handle the parsing of option files for this client. This is performed by the server option file parsing code. See for more information.

    Option Groups

    mariadb-show reads options from the following from :

    Group
    Description

    Examples

    Getting a list of databases:

    Getting a list of tables in the test database:

    Getting a list of columns in the test.book table:

    This page is licensed: CC BY-SA / Gnu FDL

    mariadb-show [OPTIONS] [database [table [column]]]

    --default-auth=name

    Default authentication client-side plugin to use.

    --default-character-set=name

    Set the default .

    --defaults-extra-file=name

    Read the file name after the global files are read. Must be given as the first option.

    --defaults-file=name

    Only read default options from the given file name. Must be given as the first option.

    --defaults-group-suffix=suffix

    In addition to the given groups, also read groups with this suffix.

    -?, --help

    Display help and exit.

    -h name, --host=name

    Connect to the MariaDB server on the given host.

    -k, --keys

    Show indexes for table.

    --no-defaults

    Don't read default options from any option file. Must be given as the first option.

    -p[password], --password[=password]

    Password to use when connecting to server. If password is not given, it's solicited on the command line. Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line.

    -W, --pipe

    On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections.

    --plugin-dir=name

    Directory for client-side plugins.

    -P num, --port=num

    Port number to use for connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306).

    --print-defaults

    Print the program argument list and exit. Must be given as the first option.

    --protocol=name

    The protocol to use for connection (tcp, socket, pipe, memory).

    --shared-memory-base-name=name

    On Windows, the shared-memory name to use, for connections made using shared memory to a local server. The default value is MYSQL. The shared-memory name is case sensitive. The server must be started with the --shared-memory option to enable shared-memory connections.

    -t, --show-table-type

    Show table type column, as in . The type is BASE TABLE or VIEW.

    -S name, --socket=name

    For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.

    --ssl

    Enables . TLS is also enabled even without setting this option when certain other TLS options are set. The --ssl option does not enable by default. In order to verify the server certificate, the user must specify the --ssl-verify-server-cert option.

    --ssl-ca=name

    Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for . This option requires that you use the absolute path, not a relative path. See for more information. This option implies the --ssl option.

    --ssl-capath=name

    Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for TLS. This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the command. See for more information. This option is only supported if the client was built with OpenSSL. If the client was built with yaSSL, GnuTLS, or Schannel, then this option is not supported. See for more information about which libraries are used on which platforms. This option implies the --ssl option.

    --ssl-cert=name

    Defines a path to the X509 certificate file to use for TLS. This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.

    --ssl-cipher=name

    List of permitted ciphers or cipher suites to use for . This option implies the --ssl option.

    --ssl-key=name

    Defines a path to a private key file to use for TLS. This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.

    --ssl-crl=name

    Defines a path to a PEM file that should contain one or more revoked X509 certificates to use for TLS. This option requires that you use the absolute path, not a relative path. See for more information. This option is only supported if the client was built with OpenSSL or Schannel. If the client was built with yaSSL or GnuTLS, then this option is not supported. See for more information about which libraries are used on which platforms. This option implies the --ssl option.

    --ssl-crlpath=name

    Defines a path to a directory that contains one or more PEM files that should each contain one revoked X509 certificate to use for TLS. This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the command. See for more information. This option is only supported if the client was built with OpenSSL. If the client was built with yaSSL, GnuTLS, or Schannel, then this option is not supported. See for more information about which libraries are used on which platforms. This option implies the --ssl option.

    --ssl-verify-server-cert

    Enables (or disables) . This option is disabled by default.

    -i, --status

    Shows a lot of extra information about each table. See the table for more details on the returned information.

    --tls-version=name

    This option accepts a comma-separated list of TLS protocol versions. A TLS protocol version will only be enabled if it is present in this list. All other TLS protocol versions will not be permitted. See for more information.

    -u, --user=name

    User for login, if not current user.

    -v, --verbose

    More verbose output; you can use this multiple times to get even more verbose output.

    -V, --version

    Output version information and exit.

    -c name, --character-sets-dir=name

    Directory for character set files.

    -C, --compress

    Use compression in server/client protocol if both support it.

    --count

    Show number of rows per table (may be slow for non-MyISAM tables).

    [name], --debug[=name]

    Output debug log. Typical is d:t:o,filename, the default is d:t:o.

    --debug-check

    Check memory and open file usage at exit.

    --debug-info

    Print some debug info at exit.

    --print-defaults

    Print the program argument list and exit.

    --no-defaults

    Don't read default options from any option file.

    --defaults-file=#

    Only read default options from the given file #.

    --defaults-extra-file=#

    Read this file after the global files are read.

    --defaults-group-suffix=#

    In addition to the default option groups, also read option groups with this suffix.

    [mysqlshow]

    Options read by mysqlshow, which includes both MariaDB Server and MySQL Server.

    [mariadb-show]

    Options read by mariadb-show.

    [client]

    Options read by all MariaDB and MySQL client programs, which includes both MariaDB and MySQL clients.

    [client-server]

    Options read by all MariaDB client programs and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients.

    [client-mariadb]

    Options read by all MariaDB client programs.

    option files
    MDEV-19035
    option groups
    option files
    bin/mariadb-show
    +--------------------+
    |     Databases      |
    +--------------------+
    | information_schema |
    | test               |
    +--------------------+
    bin/mariadb-show test
    Database: test
    +---------+
    | Tables  |
    +---------+
    | author  |
    | book    |
    | city    |
    | country |
    +---------+
    bin/mariadb-show test book
    Database: test  Table: book
    +-----------+-----------------------+-------------------+------+-----+---------+----------------+--------------------------------+---------+
    | Field     | Type                  | Collation         | Null | Key | Default | Extra          | Privileges                      | Comment |
    +-----------+-----------------------+-------------------+------+-----+---------+----------------+--------------------------------+---------+
    | id        | mediumint(8) unsigned |                   | NO   | PRI |         | auto_increment | select,insert,update,references |         |
    | title     | varchar(200)          | latin1_swedish_ci | NO   |     |         |                | select,insert,update,references |         |
    | author_id | smallint(5) unsigned  |                   | NO   | MUL |         |                | select,insert,update,references |         |
    +-----------+-----------------------+-------------------+------+-----+---------+----------------+--------------------------------+---------+
    character set
    SHOW FULL TABLES
    TLS
    verifying the server certificate
    TLS
    Secure Connections Overview: Certificate Authorities (CAs)
    openssl rehash
    Secure Connections Overview: Certificate Authorities (CAs)
    TLS and Cryptography Libraries Used by MariaDB
    TLS
    Secure Connections Overview: Certificate Revocation Lists (CRLs)
    TLS and Cryptography Libraries Used by MariaDB
    openssl rehash
    Secure Connections Overview: Certificate Revocation Lists (CRLs)
    TLS and Cryptography Libraries Used by MariaDB
    server certificate verification
    INFORMATION_SCHEMA.TABLES
    Secure Connections Overview: TLS Protocol Versions

    mariadb-admin

    Overview

    mariadb-admin is an administration program for the mariadbd daemon. It can be used to:

    • Monitor what the MariaDB clients are doing (processlist);

    • Get usage statistics and variables from the MariaDB server;

    • Create and drop databases;

    • Flush (reset) logs, statistics, and tables;

    • Kill running queries;

    • Stop the server (shutdown);

    • Start and stop replicas;

    • Check if the server is alive (ping).

    The client tool name is mariadb-admin. However, it can still be accessed under the old name, mysqladmin, via a symlink on Linux or an alternate binary on Windows.

    The name of the client tool is mysqladmin.

    Usage

    The command to use mariadb-admin and the general syntax is:

    Options

    mariadb-admin supports the following options:

    Option
    Description

    Option Files

    In addition to reading options from the command line, mariadb-admin also reads options from . If an unknown option is provided to mariadb-admin in an option file, the option is ignored.

    The following options relate to how MariaDB command line tools handles option files. They must be given as the first argument on the command line:

    Option
    Description

    mariadb-admin is linked with . However, MariaDB Connector/C does not yet handle the parsing of option files for this client. That is still performed by the server option file parsing code. See for more information.

    Option Groups

    mariadb-admin reads options from the following .

    Group
    Description

    Variables

    Variables can be set with --variable-name=value.

    Variables and boolean options
    Default value

    Commands

    Command is one or more of the following. Commands can be shortened to a unique prefix.

    Command
    Description

    The shutdown Command and the --wait-for-all-slaves Option

    The --wait-for-all-slaves option can be used in the following scenario.

    When a primary server is shut down and goes through the normal shutdown process, it kills client threads in random order. By default, the primary also considers its binary log dump threads to be regular client threads. As a consequence, the binary log dump threads can be killed while client threads still exist. This means that data can be written on the primary during a normal shutdown that won't be replicated. This is true even if is being used.

    This problem can be solved by shutting down the server with the mariadb-admin utility and by providing the --wait-for-all-slaves option:

    When the --wait-for-all-slaves option is provided, the server only kills its binary log dump threads after all client threads have been killed, and it only completes the shutdown after the last has been sent to all connected replicas.

    See for more information.

    Examples

    Quick check of what the server is doing:

    More extensive information of what is currently happening, great for troubleshooting a slow server:

    Check the variables for a running server:

    Use a shortened prefix for the version command:

    Other Ways To Stop mariadbd (Unix)

    If connecting as a user that does not have the SUPER or SHUTDOWN privilege, an error occurs:

    If you don't know the user password, you can still take the mariadbd process down like this:

    This command is identical to mariadb-admin shutdown.

    You can use the command from any client.

    See Also

    • , a tool similar to top on Unix-like systems, that allows to see what the server is doing.

    This page is licensed: CC BY-SA / Gnu FDL

    --debug-info

    Print debugging information, memory, and CPU usage statistics when the program exits.

    --default-auth=plugin

    Default authentication client-side plugin to use.

    --default-character-set=name

    Set the default character set.

    -f, --force

    Don't ask for confirmation on drop database. With multiple statements, continue even if an error occurs.

    -?, --help

    Display help and exit.

    -h name, --host=name

    Hostname to connect to.

    -l, --local

    Suppress SQL statements from being written to the , by enabling for flush commands, using FLUSH LOCAL rather than SET sql_log_bin=0 . The privilege required is RELOAD .

    -b, --no-beep

    Turn off beep on error.

    -p[password], --password[=password]

    Password to use when connecting to server. If password is not given, it's asked from the terminal.

    --pipe, -W

    On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections.

    -P portnum, --port=portnum

    Port number to use for the connection. If it's 0 , do not use the port.

    If it's set, and if $MYSQL_TCP_PORT is set, use the port.

    Otherwise, and if /etc/services has a port number specified, use that port number.

    If nothing is set, use the built-in default (3306).

    --protocol={tcp|socket|pipe|memory}

    The protocol to use for the connection (tcp, socket, pipe, memory).

    -r, --relative

    Show difference between current and previous values when used with -i. Only works in combination with extended-status.

    -O val, --set-variable=val

    Change the value of a variable to val. This option is deprecated; you can set variables directly with --variable-name=val.

    --shutdown_timeout=val

    Maximum number of seconds to wait for server shutdown. The default value is 3600 (1 hour).

    -s, --silent

    Silently exit if you can't connect to server.

    -i delay, --sleep=delay

    Execute commands repeatedly, sleeping for delay seconds in between. The --count option determines the number of iterations. If --count is not given, mariadb-admin executes commands indefinitely until interrupted.

    -S name, --socket=name

    For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.

    --ssl

    Enables . TLS is also enabled even without setting this option when certain other TLS options are set. The --ssl option doesn't enable by default. In order to verify the server certificate, you must specify the --ssl-verify-server-cert option.

    --ssl-ca=name

    Define a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for . This option requires the use of an absolute path, not a relative path. See for more information. This option implies the --ssl option.

    --ssl-capath=name

    Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for . This option requires the use of an absolute path, not a relative path. The directory specified by this option needs to be run through the command. See for more information. This option is only supported if the client was built with OpenSSL or yaSSL. If the client was built with GnuTLS or Schannel, then this option is not supported. See for more information about which libraries are used on which platforms. This option implies the --ssl option.

    --ssl-cert=name

    Define a path to the X509 certificate file to use for . This option requires the use of an absolute path, not a relative path. This option implies the --ssl option.

    --ssl-cipher=name

    List of permitted ciphers or cipher suites to use for . This option implies the --ssl option.

    --ssl-crl=name

    Define a path to a PEM file that should contain one or more revoked X509 certificates to use for . This option requires that you use the absolute path, not a relative path. See for more information. This option is only supported if the client was built with OpenSSL or Schannel. If the client was built with yaSSL or GnuTLS, then this option is not supported. See for more information about which libraries are used on which platforms.

    --ssl-crlpath=name

    Define a path to a directory that contains one or more PEM files that should each contain one revoked X509 certificate to use for . This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the command. See for more information. This option is only supported if the client was built with OpenSSL. If the client was built with yaSSL, GnuTLS, or Schannel, then this option is not supported. See for more information about which libraries are used on which platforms.

    --ssl-key=name

    Define a path to a private key file to use for . This option requires the use of an absolute path, not a relative path. This option implies the --ssl option.

    --ssl-verify-server-cert

    Enable . This option is disabled by default.

    --tls-version=name

    Accept a comma-separated list of TLS protocol versions. A TLS protocol version will only be enabled if it is present in this list. All other TLS protocol versions will not be permitted. See for more information.

    -u, --user=name

    User for login, if not current user.

    -v, --verbose

    Write more information.

    -V, --version

    Output version information and exit.

    -E, --vertical

    Print output vertically. Is similar to '--relative', but prints output vertically.

    -w[count], --wait[=count]

    If the connection cannot be established, wait and retry instead of aborting. If a count value is given, it indicates the number of times to retry. The default is one time.

    --wait-for-all-slaves

    Wait for the last binlog event to be sent to all connected replicas before shutting down. This option is off by default.

    default-character-set

    (No default value)

    host

    (No default value)

    no-beep

    FALSE

    port

    3306

    relative

    FALSE

    socket

    /var/run/mariadbd/mariadbd.sock

    sleep

    0

    ssl

    FALSE

    ssl-ca

    (No default value)

    ssl-capath

    (No default value)

    ssl-cert

    (No default value)

    ssl-cipher

    (No default value)

    ssl-key

    (No default value)

    ssl-verify-server-cert

    FALSE

    user

    (No default value)

    verbose

    FALSE

    vertical

    FALSE

    connect_timeout

    43200

    shutdown_timeout

    3600

    flush-binary-log

    Flush .

    flush-client-statistics

    Flush client statistics.

    flush-engine-log

    Flush engine log.

    flush-error-log

    Flush .

    flush-general-log

    Flush .

    flush-hosts

    Flush all cached hosts.

    flush-index-statistics

    Flush index statistics.

    flush-logs

    Flush all logs.

    flush-privileges

    Reload grant tables (same as reload).

    flush-relay-log

    Flush .

    flush-slow-log

    Flush slow query log.

    flush-ssl

    Flush SSL certificates. Available from MariaDB 10.6.0.

    flush-status

    Clear .

    flush-table-statistics

    Clear table statistics.

    flush-tables

    Flush all tables.

    flush-threads

    Flush the thread cache.

    flush-user-resources

    Flush user resources.

    flush-user-statistics

    Flush user statistics.

    kill id,id,...

    Kill mysql threads.

    password new-password

    Change old password to new-password. The new password can be passed on the command line as the next argument (for example, mariadb-admin password "new_password", or can be omitted (as long as no other command follows), in which case the user is prompted for a password. If the password contains special characters, it needs to be enclosed in quotation marks. In Windows, the quotes can only be double quotes, as single quotes are assumed to be part of the password. If the server was started with the option, changing the password in this way will have no effect.

    old-password new-password

    Change old password to new-password using the old pre-MySQL 4.1 format.

    ping

    Check if mariadbd is alive. Return status is 0 if the server is running (even in the case of an error such as access denied), 1 if it is not.

    processlist

    Show list of active threads in server, equivalent to . With --verbose, it is an equivalent to .

    reload

    Reload grant tables.

    refresh

    Flush all tables and close and open log files.

    shutdown

    Take the server down by executing the command on the server. If connected to a local server using a Unix socket file, mariadb-admin waits until the server's process ID file is removed, to ensure that the server stopped properly. See also the --wait-for-all-slaves option.

    status

    Give a short status message from the server.

    start-all-slaves

    Start all replicas.

    start-slave

    Start replication on a replica server.

    stop-all-slaves

    Stop all replicas.

    stop-slave

    Stop replication on a replica server.

    variables

    Print variables available.

    version

    Return version as well as status info from the server.

    --character-sets-dir=dir

    Directory where the character set files are located.

    -C, --compress

    Compress all information sent between the client and the server if both support compression.

    --connect_timeout=val

    Maximum time in seconds before connection timeout. The default value is 43200 (12 hours).

    -c val, --count=val

    Number of iterations to make. This works with -i (--sleep) only.

    -# [debug_options], --debug[=debug_options]

    Write a debugging log. A typical debug_options string is d:t:o,file_name. The default is d:t:o,/tmp/mysqladmin.trace.

    --debug-check

    Check memory and open file usage on exit.

    --print-defaults

    Print the program argument list and exit.

    --no-defaults

    Don't read default options from any option file.

    --defaults-file=#

    Only read default options from the given file #.

    --defaults-extra-file=#

    Read this file after the global files are read.

    --defaults-group-suffix=#

    In addition to the default option groups, also read option groups with this suffix.

    [mysqladmin]

    Options read by mysqladmin, which includes both MariaDB Server and MySQL Server.

    [mariadb-admin]

    Options read by mariadb-admin.

    [client]

    Options read by all MariaDB and MySQL client programs, which includes both MariaDB and MySQL clients. For example, mysqldump.

    [client-server]

    Options read by all MariaDB client programs and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients.

    [client-mariadb]

    Options read by all MariaDB client programs.

    count

    0

    debug-check

    FALSE

    debug-info

    FALSE

    force

    FALSE

    compress

    FALSE

    character-sets-dir

    (No default value)

    create db

    Create a database named db.

    debug

    Instruct server to write debug information to log.

    drop db

    Delete a database named db and all its tables.

    extended-status

    Return all status variables and their values.

    flush-all-statistics

    Flush all statistics tables

    flush-all-status

    Flush status and statistics.

    option files
    MDEV-19035
    option groups
    semi-synchronous replication
    binary log
    Replication Threads: Binary Log Dump Threads and the Shutdown Process
    SHUTDOWN
    SHUTDOWN
    mytop
    mariadb-admin [options] command [command-arg] [command [command-arg]] ...
    mariadb-admin [options] command [command-arg] [command [command-arg]] ...
    mariadb-admin --wait-for-all-slaves shutdown
    shell> mariadb-admin status
    Uptime: 8023 Threads: 1 Questions: 14 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.1
    shell> mariadb-admin processlist
    +----+-------+-----------+----+---------+------+-------+------------------+
    | Id | User | Host | db | Command | Time | State | Info |
    +----+-------+-----------+----+---------+------+-------+------------------+
    ....
    +----+-------+-----------+----+---------+------+-------+------------------+
    shell> mariadb-admin --relative --sleep=1 extended-status | grep -v " 0 "
    shell> mariadb-admin variables | grep datadir
    | datadir | /my/data/ |
    shell> mariadb-admin ver
    mariadb-admin from 11.1.0-preview-MariaDB, client 9.1 for linux-systemd (x86_64)
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Server version		11.1.0-preview-MariaDB
    Protocol version	10
    Connection		localhost via TCP/IP
    TCP port		11100
    Uptime:			3 min 21 sec
    
    Threads: 1  Questions: 1  Slow queries: 0  Opens: 17  Open tables: 10  Queries per second avg: 0.004
    mariadb-admin: shutdown failed; error: 'Access denied; you need (at least one of) the SHUTDOWN privilege(s) for this operation'
    kill -SIGTERM pid-of-mariadbd-process
    NET STOP MySQL
    binary log
    sql_log_bin=0
    TLS
    verifying the server certificate
    TLS
    Secure Connections Overview: Certificate Authorities (CAs)
    TLS
    openssl rehash
    Secure Connections Overview: Certificate Authorities (CAs)
    TLS and Cryptography Libraries Used by MariaDB
    TLS
    TLS
    TLS
    Secure Connections Overview: Certificate Revocation Lists (CRLs)
    TLS and Cryptography Libraries Used by MariaDB
    TLS
    openssl rehash
    Secure Connections Overview: Certificate Revocation Lists (CRLs)
    TLS and Cryptography Libraries Used by MariaDB
    TLS
    server certificate verification
    Secure Connections Overview: TLS Protocol Versions
    binary log
    error log
    general query log
    relay log
    status variables
    --skip-grant-tables
    SHOW PROCESSLIST
    SHOW FULL PROCESSLIST
    SHUTDOWN
    MariaDB Connector/C
    MariaDB Connector/C