Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Discover MariaDB Server's clients and utilities. This section guides you through tools for connecting, managing, and interacting with your database, from command-line clients to graphical interfaces.
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 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
Explore Aria clients and utilities for MariaDB Server. This section details specialized tools for managing and interacting with tables that utilize the Aria storage engine.
Explore backup, restore, and import clients for MariaDB Server. This section details various utilities that facilitate data protection, recovery, and seamless data loading into your databases.
Explore graphical and enhanced clients for the Server. This section details various tools, such as command-line clients and GUIs, to simplify database administration, development, and data management.
Explore logging tools for MariaDB Server. This section introduces utilities and methods for managing and analyzing server logs, crucial for monitoring activity and troubleshooting issues.
Use mariadb-binlog to process binary log files. This utility is essential for examining replication events, recovering from data loss, and auditing changes in your MariaDB Server.
Explore deployment tools for MariaDB Server. This section introduces utilities and scripts that simplify the installation, configuration, and management of MariaDB in various environments.
The MariaDB command line client. Previously, the client was called `mysql`. The client can still be accessed in this way, via a symlink in Linux, or an alternate binary in Windows.
Explore networking tools for MariaDB Server. This section introduces utilities that help you manage and troubleshoot network connections to your database, including monitoring and security.
Explore table-related tools for MariaDB Server. This section details various utilities for managing table structures, performing maintenance, and optimizing data storage.
MariaDB uses mariadb-test to test functionality. It is an all-in-one test framework doing unit, regression, and conformance testing
Explore MyISAM clients and utilities for MariaDB Server. This section details specialized tools for managing and maintaining tables that utilize the MyISAM storage engine.
Explore testing tools for MariaDB Server. This section introduces utilities that help you validate server functionality, test configurations, and ensure the reliability of your database deployments.
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:
--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.
This page is licensed: CC BY-SA / Gnu FDL
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.
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.
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
Adminer is a database administration web interface. It is usable via a web browser. It is written in PHP and requires a web server.
Adminer mainly supports MySQL, but it also supports MariaDB and other database management systems. Adminer has a wide range of plugins, some of which have been developed by the community.
Adminer is distributed with a dual license: Apache License 2.0 and GPL 2. Adminer does not have a commercial edition, but it accepts donations.
This page is licensed: CC BY-SA / Gnu FDL
dbForge Fusion is an add-in for Visual Studio. It provides automatic and simple MariaDB database development, and boosts data management capacity. With this tool integrated, it is easy to work with database development and administration tasks from Visual Studio.
DbSchema helps you design, document and manage databases. Design new tables, generate HTML5 documentation, explore and edit the database data, compare and synchronize the schema over multiple databases, edit and execute SQL, and generate random data.
DbSchema is compatible with all relational and some No-SQL databases. It works on all major operating systems, including Windows, Linux and macOS.
You can download and evaluate DbSchema 15 days for free.
This page is licensed: CC BY-SA / Gnu FDL
DbVisualizer is a cross-platform database tool for developers, DBAs, analysts and SQL programmers. Both Free and paid Pro versions are available. Supported databases include MySQL, MariaDB, and PostgreSQL.
DbVisualizer has been carefully developed by a small and dedicated team. Development decisions are based on user feedback.
Example of features:
Simple navigation of database objects and their properties.
Visual rendering of primary/foreign keys.
Table data editing in spreadsheet with Export and import database schema.
Flexible user interface in light and dark themes.
Query optimization with an explain plan feature.
Visual query builder using drag and drop.
Flexible SQL scripts execution with parameter support.
SQL formatting and Command-line interface for headless execution.
.
This page is licensed: CC BY-SA / Gnu FDL
Sequel Pro is a fast, database management application for working with MySQL and MariaDB databases. It runs on macOS only.
Sequel Pro is open source, so it's easy to be involved and enhance it for MariaDB.
If you have any issues with Sequel Pro on MariaDB, please use the issue tracking for that!
This page is licensed: CC BY-SA / Gnu FDL
mycli is a command-line interface for MariaDB, MySQL, and Percona, with auto-completion and syntax highlighting. It is written in Python, and runs on Linux, Mac and Windows.
Read more at mycli.net.
This page is licensed: CC BY-SA / Gnu FDL
phpMyAdmin is a web-based tool for administering MariaDB and MySQL.
It requires a web server, PHP, and a browser.
Read more at phpmyadmin.net.
This page is licensed: CC BY-SA / Gnu FDL
Generate and populate databases with large volumes of realistic test data.
SB Data Generator is a simple and powerful GUI tool for creating large volumes of realistic test data to populate selected tables or entire databases. The tool reverses your database and displays tables and columns, so you can assign to them multiple data generator templates. It includes multiple built-in generators that allow populating MariaDB database tables with realistic data of various types.
Key Benefits:
Understand your database structure by visualizing the ER Diagram (tables, columns, relationships, keys, sequences, indexes, and triggers).
Ability to generate a large volume of realistic test data.
Preview what data is generated before populating the database with test data.
Multiple built-in generators available with the ability to create custom data generators.
Generate test data for most popular DBMS including MariaDB and MySQL.
.
This page is licensed: CC BY-SA / Gnu FDL
Toad Edge is a database management application that allows you to perform database administration tasks with ease.
Toad Edge allows you to:
Connect to your MySQL database, view, explore and edit database structure, database objects and properties.
Manage database objects, easily add, edit or drop objects in Object Explorer.
Manage data stored in your database, add, edit or remove records.
Write complex SQL code comfortably in Worksheet.
Compare and synchronize databases using powerful Schema Compare.
Obtain detailed information about your databases.
More information .
This page is licensed: CC BY-SA / Gnu FDL
mysqlbinlog is a client tool which is called mariadb-binlog now. It can still be accessed under its original name via a symlink in Linux, or an alternate binary in Windows.
This page is licensed: CC BY-SA / Gnu FDL
mysql is a simple SQL shell with GNU readline capabilities.
This page is licensed: GPLv2
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!
resolve_stack_dump is a tool that resolves numeric stack strace dumps into symbols.
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.
is an open-source database GUI available for Linux, MacOS, and Windows.
Beekeeper Studio works with MariaDB, but also works with other databases.
Beekeeper Studio includes the following features:
Tabbed interface.
SSH tunneling.
is a monitoring tool that gives database administrators real-time insights for optimizing the performance of MariaDB servers.
Key Features:
Agentless monitoring.
Fully customizable.
Affordable.
Webyog’s SQL DM is fully compatible with Amazon Aurora databases, and Webyog is an Amazon launch partner.
is a Windows application (which works fine under Wine on Linux) for database design, development, maintenance and testing for several database systems, including MySQL and MariaDB.
With Database Workbench you can:
design a database;
connect to multiple databases;
view and modify meta data;
is a GUI data modeling tool that allows developers to visualize, design, and model databases by using entity relationship diagrams and automatically generate the most popular SQL databases, and to generate and share the data model documentation. Optimize your data model by using advanced features such as test data generation, schema compare, and schema synchronization.
Supported DBMS include MariaDB, MySQL, and Microsoft SQL Server.
Key features:
Visual data modeling.
Forward and Reverse Engineering.
is a free multi-platform database tool for developers, SQL programmers, database administrators and analysts. It supports many popular relational databases like MySQL, MariaDB, and PostgreSQL.
A list of basic features:
Data viewer and editor: sorting, filtering, image displaying, export of selected data and much more.
Metadata browser: possibility to view and edit existing tables, views, columns, indexes, procedures, triggers, storage entities (tablespaces, partitions, etc), security entities (users, roles, etc).
is a database design tool for MariaDB and other relational databases.
Draw diagrams, reverse engineer existing database structures and generate SQL code.
Supported platforms include MariaDB, PostgreSQL, and SQLite.
Key features:
Database modeling & schema design.
Reverse engineering.
is a graphical frontend for MariaDB. It is a commercial product with several different versions (Navicat Premium, Navicat for MySQL, etc...) and different "editions" within those versions (Non-commercial, Standard, and Enterprise). Certain features are only available in certain editions/versions.
Navicat is available for Windows, MacOS, and Linux.
In addition to standard client features, it includes
An SQL Builder/Editor,
A Data Modeling Tool (Enterprise version only),
The Ocelot GUI (ocelotgui), a database client, allows to connect to a MySQL or MariaDB server, enter SQL statements, and receive results. Features include syntax highlighting, user-settable colors and fonts for each part of the screen, resultset displays with multiline rows and resizable columns, and a debugger.
Visit for more information and to download.
This page is licensed: CC BY-SA / Gnu FDL
Querious is a database administration tool for macOS.
It can be purchased and downloaded at .
This page is licensed: CC BY-SA / Gnu FDL
is a fully native database client for macOS and . It supports database management systems such as MariaDB, MySQL, and Postgres.
Features include:
Syntax highlighting & Autocomplete (sometimes called intellisense).
Customizable themes allowing the query editor to be completely customized.
SQLyog is a GUI tool to manage MySQL and MariaDB servers and databases in physical, virtual, and cloud environments. DBAs, developers, and database architects alike, use SQLyog to visually compare, optimize, and document schemas.
Key Features:
Automatically synchronize data,
Visually compare data, and
Import external data.
Additional Highlights:
is a graphical front end for MariaDB with a free version, and a Pro version that adds advanced features.
Free Valentina Studio offers the following features:
natively available on macOS, Windows & Linux,
a feature rich, visual SQL Editor with powerful search functionality,
SQLDIFF,
mariadb-setpermission [options]./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-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.
mariadb-conv supports the following options:
-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.
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.
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:
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
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 |
+------+-----------+-------------------------------------------+-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.
This page is licensed: CC BY-SA / Gnu FDL
resolve_stack_dump [OPTIONS] symbols-file [numeric-dump-file]Multi-connection.
The Community Edition is free and open source, and is privacy respecting, with no usage tracking or similar behavior.
Links
Homepage - beekeeperstudio.io
GitHub - beekeeper-studio
This page is licensed: CC BY-SA / Gnu FDL

Features specifically for RDS and Aurora instances also available. SQL Diagnostic Manager is browser based and is a proud MariaDB Monitor and Advisor.
SQLyog Ultimate is a MySQL administration tool for DBAs, developers, and database architects. This tool enables database developers, administrators, and architects to visually compare, optimize, and document schemas.
Key Features:
Automatically synchronize data.
Visually compare data.
Import external data.
SQLyog runs on Windows and is a graphical MariaDB manager and admin tool, combining the features of MySQL Administrator, phpMyAdmin and other MariaDB frontend tools.
This page is licensed: CC BY-SA / Gnu FDL
view and modify data;
import and export data;
connect to any ODBC/ADO data source;
transfer data between database systems;
migrate meta data;
compare meta data;
manage privileges;
debug stored procedure;
print meta data or data.
It includes numerous other tools.
Database Workbench comes in multiple editions and is licensed on a per-module basis.
This page is licensed: CC BY-SA / Gnu FDL
Data Model Validation.
Data model documentation.
Schema Comparison and Synchronization.
Test data generation.
Change Database Platform.
Generate web user interface for CRUD.
Version management.
A feature-limited free version is available for download. Advanced features are available in the commercial edition. A feature comparison matrix is available for more details about features, pricing, and trial versions.
See www.soft-builder.com for more information.
This page is licensed: CC BY-SA / Gnu FDL
ER diagrams: possibility to automatically generate ER diagrams for a database/schema (diagram will contain all schema tables) or for a single table and export the diagram in a suitable format.
SQL editor: possibility to organize all your scripts in folders, reassign database connections for particular scripts.
Data and metadata search: full-text data search using against all chosen tables/views.
Database structure comparing: possibility to perform objects structure compare.
Usability is the main goal of this project, so the program UI is carefully designed and implemented. Users can send bug report and feature request on the GitHub page.
This page is licensed: CC BY-SA / Gnu FDL
Support for database-specific settings.
Three display modes: metadata, sample data or descriptions.
Default values for newly created objects.
Export to PDF.
Dark and Light themes.
SQL script generation.
Supported OS
Luna Modeler is available for Windows, Linux and macOS.
More information
See www.datensen.com for more information.
This page is licensed: CC BY-SA / Gnu FDL
Report Builder (Windows-only),
"Premium" version which can connect to MariaDB, MySQL, SQL Server, SQLite, Oracle, and PostgreSQL databases simultaneously.
A feature comparison matrix is available. More information, including pricing and trial versions, is available on the Navicat website.
This page is licensed: CC BY-SA / Gnu FDL
Improved query error detection (errors in queries is underlined red).
Full dark mode & light mode support, along with custom themes.
Other features include:
Complete SSH Tunnel support.
Inline data filtering.
Exporting & Exporting options to CSV, JSON & XML.
This page is licensed: CC BY-SA / Gnu FDL

Runs on Microsoft Windows with no dependencies on runtimes (such as Microsoft .NET and Java) and database abstraction layers (such as ODBC and JDBC).
Distributed as a free Community edition and as a paid, proprietary Ultimate edition.
More information can be found here.
This page is licensed: CC BY-SA / Gnu FDL
a highly productive Data Editor,
support for many data sources,
ODBC import,
Schema Editor with powerful visual diagramming features, Diagram Editor; import diagrams from MySQL Workbench,
Report Viewer with printing, export to PDF and HTML (local reports and from Valentina Server),
Forms Client for working with visual forms and MariaDB (locally and from Valentina Server),
Free supports most popular data sources, MariaDB, MySQL, SQL Server, SQLite, PostgreSQL and more.
Use the Valentina Studio FREE vs Valentina Studio PRO feature matrix to see which version is best for your needs or download to immediately evaluate.
This page is licensed: CC BY-SA / Gnu FDL

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.
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).
mariadb-find-rows supports the following options:
This page is licensed: CC BY-SA / Gnu FDL
mariadb_waitpid is a utility for terminating processes.
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.
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.
This page is licensed: CC BY-SA / Gnu FDL
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.
my_print_defaults [OPTIONS] [groups] 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
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:
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:
replace supports the following options:
This page is licensed: CC BY-SA / Gnu FDL
dbForge Edge is a versatile software solution designed to meet the needs of full-stack database specialists. It offers a wide range of features to address database challenges across major providers: MySQL/MariaDB, SQL Server, Oracle, and PostgreSQL. When it comes to MySQL and MariaDB, dbForge Edge provides a highly functional IDE that covers almost all aspects of database development and management.
Features are described in the following.
dbForge Edge includes a built-in Database Designer equipped with ER diagrams, allowing users to construct and edit databases. An intuitive interface facilitates the creation of database structures and generation of reusable SQL scripts for creating actual databases. Table Designer is a separate feature for visual creation and management of tables that covers the setup of columns, data types, constraints, etc.
dbForge Edge offers a powerful set of features to simplify SQL coding tasks. The code assistance module offers context-based keyword and object suggestions, code completion, instant syntax validation, customizable code formatting profiles, debugging, and code refactoring capabilities. Another feature worth mentioning is Query Builder – a tool that allows users to construct even the most complex SQL queries effortlessly in a visual mode.
The solution incorporates schema and data comparison tools, enabling users to identify and manage differences in database schemas and table data. With automatically generated synchronization scripts, changes can be seamlessly deployed to target platforms. Comparison and synchronization jobs can also be automated, improving user efficiency.
dbForge Edge supports data migration (import and export) in over 10 major data formats. Both the import and export processes can be tailored to meet any specific requirements and automated for efficient workflows.
Also, dbForge Edge delivers Source Control, an integrated tool that enables version control of database schemas and static data, available for MariaDB, MySQL, and SQL Server databases. With its help, users can compare database versions, commit and revert changes with dependency awareness, view and resolve conflicts, and examine the history of changes. Source Control supports all popular version control systems, such as Git (including GitHub, GitLab, Azure DevOps, and Bitbucket), Apache Subversion (SVN), TFVC, Mercurial (Hg), Perforce (P4), and SourceGear Vault.
The solution features a robust Data Generator capable of producing high-quality test data in varying volumes and formats. Additionally, the Query Profiler tool enables comprehensive analysis and optimization of queries, thereby saving valuable time and resources.
The dedicated module deals with user management configurations. The functionality provided by the software allows easy creation, editing, and management of user accounts and privileges.
With dbForge Edge, users can create detailed database documentation in various formats and with convenient navigation. The reporting module enables the summarization and analysis of data, presenting comprehensive reports with informative graphs, diagrams, and pivot tables.
dbForge Edge is not just a comprehensive IDE for MySQL and MariaDB. It also serves as an all-in-one solution for database experts who work with multiple database management systems, eliminating the need to assemble toolsets for each. With its extensive feature set, dbForge Edge empowers professionals to efficiently perform their tasks across diverse database environments.
.
This page is licensed: CC BY-SA / Gnu FDL
DeZign for Databases is a data modeling tool for developers and DBA's that helps model, create, and maintain MariaDB databases. It runs on Windows only.
Supported database management systems include MariaDB, MySQL, and SQL Server.
Key features:
Visual database modeling (Entity relationship diagrams).
Generate database schemas directly from the data model.
Incorporate changes from live databases into your existing models.
Create change scripts by comparing your model with the live database structure.
Publish and maintain data definitions to ensure consistency and accessibility.
Convert models into SQL, streamlining database creation.
Create clear and visually appealing ER diagrams, including sub-diagrams for complex systems.
Support version control to manage different iterations of your model.
See for more information.
This page is licensed: CC BY-SA / Gnu FDL
KS DB Merge Tools for MySQL and MariaDB is a diff & merge tool for MySQL and MariaDB, allowing to compare and sync both schema and data. It is a Freemium application - many features are exposed in the Free version (available for commercial use), some extended features are available only in the paid Standard version (in many cases can be provided at no cost for open source developers).
Application has tabbed UI, there are several types of tabs responsible for particular application features and scope of tasks. Here are the primary application tabs:
It is a starting point to open databases. Shows summary about all database objects. Note that it does not provide information about data/content changes, only about object definitions.
This tab is also used as a starting point to manage diff profiles, making it easy to customize the tool for your specific database project. Here, you can save and reuse custom queries, mappings, and data slices, allowing you to create tailored data diff summaries.
Lists all objects of some particular type - tables, views, etc. Allows to identify whether some object is new, changed or unchanged (note that for tables and views it does not provide information about data/content changes, only about object definitions). Quick filters available to show only new/changed/new+changed objects. Here we can select required objects on one side and generate a synchronization script to merge these changes to the other side.
Compares data for particular table or view. Quick filters available to show only new, changed, or new and changed rows. We can select required rows on one side and generate synchronization script to merge these changes to the other side.
Compares definition of some particular database programming object like view or stored procedure.
Compares definition of particular table. Here we can select required changes and generate synchronization script for them. This tab is available only in the Standard version, the Free version is using Text diff tab to compare table definitions.
Allows to compare data for multiple tables and views, providing summary of data changes for the whole database. This tab is available only in the Standard version.
Compares arbitrary query results, it can be the same query running on both databases or different queries running on the same or different databases. This tab is available only in the Standard version.
The Standard version has support of own domain-specific scripting language designed to automate diff and merge tasks provided by GUI. In addition to the primary GUI, there is a Script Editor application designed to help in writing and troubleshooting scripts and a separate command line utility that is used to run these scripts without user interaction. For the most typical tasks the scripts can be generated just with a single button click on GUI which produces a script relevant for the data or objects you currently observe on UI.
This page is licensed: CC BY-SA / Gnu FDL
TablePlus is an application with a clean user interface that allows developers to simultaneously manage databases in a very fast and secure way. It supports many popular database management systems like MariaDB, MySQL, and Postgres.
TablePlus is is available for macOS, Windows, iOS, and Linux.
Some notable features:
Native build.
Convenient query editor.
Multi Tabs & Code Review.
Can connect to multiples databases simultaneously.
TablePlus is available for free, but users can purchase a license to remove some limitations and customize the tool for higher needs on .
This page is licensed: CC BY-SA / Gnu FDL
mariadb-fix-extensions converts the extensions for MyISAM (or ISAM) table files to their canonical forms.
It looks for files with extensions matching any lettercase variant of .frm, .myd, .myi, .isd, and .ism and renames them to have extensions of .frm, .MYD, .MYI, .ISD, and .ISM, respectively. This can be useful after transferring the files from a system with case-insensitive file names (such as Windows) to a system with case-sensitive file names.
Invoke mariadb-fix-extensions as follows, where data_dir is the path name to the MariaDB data directory:
This page is licensed: CC BY-SA / Gnu FDL
innochecksum is a tool for printing checksums for InnoDB files.
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.
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.
is a useful tool for the MariaDB database that allows for the automatic generation of database documentation in such formats as HTML, PDF, and Markdown. Users can adjust the created documentation with a great variety of options.
Features are described in the following.
Search as you type. View the highlighted matching text after entering the name of a required object in the search field.
mariadb-dumpslow is a tool to examine the .
It parses the slow query log files, printing a summary result. Normally, mariadb-dumpslow groups queries that are similar, except for the particular values of number and string data values. It “abstracts” these values to N and ´S´ when displaying summary output. The -a and -n
Sometimes you need to work when your computer is busy running . The mariadb-test-run.pl script allows you to stop it temporarily so you can use your computer and then restart the tests when you're ready.
There are two ways to enable this:
Command-line: The --stop-file and--stop-keep-alive options.
Environment Variables: If you are calling mariadb-test-run.pl indirectly
(i.e from a script or program such as buildbot) you can setMTR_STOP_FILE and MTR_STOP_KEEP_ALIVE
myisamchk's performance can be dramatically enhanced for larger tables by making sure that its memory-related variables are set to an optimum level.
By default, myisamchk will use very little memory (about 3MB is allocated), but can temporarily use a lot of disk space. If disk space is a limitation when repairing, the --safe-recover option should be used instead of --recover. However, if TMPDIR points to a memory file system, an out of memory error can easily be caused, as myisamchk places temporary files in TMPDIR. The --tmpdir=path option should be used in this case to specify a directory on disk.
myisamchk has the following requirements for disk space:
When repairing, space for twice the size of the data file, available in the same directory as the original file. This is for the original file as well as a copy. This space is not required if the --quick option is used, in which case only the index file is re-created.
When testing the S3 storage engine with the s3 test suite, needs access to Amazon S3 compatible storage.
The easiest way to achieve this is to install , an open source S3 compatible storage.
Here is a shell script that you can use to install MinIO with the right credentials for . This should work on most Linux systems as the binaries are statically linked. You can alternatively download MinIO binaries directly from .
Now you can run the S3 test suite:
If there is an issue while running the test suite, you can see the files created by MinIO with:
or
If you want to use MinIO with different credentials or you want to run the test against another S3 storage you ave to update the update the following files:
This page is licensed: CC BY-SA / Gnu FDL
OmniDB is a browser-based tool that simplifies MariaDB database management focusing on interactivity. It is designed to be powerful and lightweight.
Characteristics:
Browser-based Tool: Accessible from any platform, using a browser as a medium.
Responsive Interface: All available functions in a single page.
Unified workspace: Different technologies managed in a single workspace.
mariadb-access [host [user [db]]] OPTIONS$MYSQL = ´/usr/local/bin/mariadb;
path to mariadb executablemariadb-conv [OPTION...] [FILE...]mariadb-conv -f latin1 -t utf8 file.latin1.txtmariadb-conv -f latin1 -t utf8 < file.latin1.txtecho test | ./mariadb-conv -f utf8 -t ucs2 >file.ucs2.txtSET 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.ibdls | mariadb-conv -f filename -t utf8 --delimiter=".\n"
ß.frm
ß.ibd
桌子.frm
桌子.ibd
абв.frm
абв.ibd
t1.frm
t1.ibddir /b | mariadb-conv -c -f filename -t cp850 --delimiter=".\r\n"shell> replace from to [from to] ... -- file_name [file_name] ...
shell> replace from to [from to] ... < file_name














This page is licensed: CC BY-SA / Gnu FDL
Simplified Editing: Easy to add and remove connections.
Safety: Multi-user support with encrypted personal information.
Interactive Tables: All functionalities use interactive tables, allowing copying and pasting in blocks.
Smart SQL Editor: Contextual SQL code completion.
Beautiful SQL Editor: You can choose between many available color themes.
Tabbed SQL Editor: Easily add, rename or delete editor tabs.
More information can be found here.
This page is licensed: CC BY-SA / Gnu FDL
--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, --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.
^
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.
Option
Description
-?, --help
Display help and exit.
-I, --info
Synonym for --help.
-s, --silent#
Be more silent.
-V, --version
Display version information and exit.
mariadb-fix-extensions data_dir# Where to install the MinIO binaries and where to store the data
install=/my/local/minio
data=/tmp/shared
# Get the MinIO binaries. You can skip this test if you already have MinIO installed.
mkdir -p $install
wget https://dl.min.io/server/minio/release/linux-amd64/minio -O $install/minio
wget https://dl.min.io/client/mc/release/linux-amd64/mc -O $install/mc
chmod a+x $install/minio $install/mc
# Setup MinIO for usage with mariadb-test-run
MINIO_ACCESS_KEY=minio MINIO_SECRET_KEY=minioadmin $install/minio server $data 2>&1 &
$install/mc config host add local http://127.0.0.1:9000 minio minioadmin
$install/mc mb --ignore-existing local/storage-enginecd "mysql-source-dir"/mariadb-test
./mariadb-test-run --suite=s3mariadb-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.
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.
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
Don't abstract all numbers to N and strings to 'S'.
Debug mode.
Grep: only consider statements that include this string pattern.
Display help.
Hostname of db server for -slow.log filename (can be a wildcard). The Default is '', that is, match all hosts.
Name of server instance (if using mysql.server startup script).
Don't subtract lock time from total time.
Stores the dumped data in JSON format. Available from MariaDB 12.1.
Abstract numbers with at least this number of digits within names.
Reverse the sort order (largest last instead of first).
What to sort by (aa, ae, al, ar, at, a, c, e, l, r, t). The default is at . The meaning of the abbreviations is:
aa – average rows affected
ae – aggregated number of rows examined
al – average lock time
ar – average rows sent
at – average query time
a – rows affected
c – count
e – rows examined
l – lock time
r – rows sent
t – query time:
Just show the top number of queries.
Verbose mode.
This page is licensed: CC BY-SA / Gnu FDL
If you plan on using this feature with other programs, such as buildbot, you should set the MTR_STOP_KEEP_ALIVE environment variable or the --stop-keep-alive command line option with a value in seconds. This will make the script print messages to whatever program is calling mariadb-test-run.pl at the interval you set to prevent timeouts.
If you are calling mariadb-test-run.pl directly, you do not need to specify a timeout.
The stop file is a temporary file that you create on your system when you want to pause the execution of mariadb-test-run. When enabled via the command line or environment variable options, mariadb-test-run will periodically check for the existence of the file and if it exists it will stop until the file is no longer present.
Command-line:
Environment Variables:
This page is licensed: CC BY-SA / Gnu FDL
mariadb-test-run.pl --stop-file="/path/to/stop/file" --stop-keep-alive=120Space for a new index file to replace the existing one. The old index is first truncated, so unless the old index file is not present or is smaller for some reason, no significant extra space is needed.
There are a number of system variables that are useful to adjust when running myisamchk. They will increase memory usage, and since some are per-session variables, you don't want to increase the general value, but you can either pass an increased value to myisamchk as a command line option, or with a [myisamchk] section in your my.cnf file.
sort_buffer_size. By default this is 4M, but it's very useful to increase to make myisamchk sorting much faster. Since the server won't be running when you run myisamchk, you can increase substantially. 16M is usually a minimum, but values such as 256M are not uncommon if memory is available.
key_buffer_size (which particularly helps with the --extend-check and --safe-recover options.
For example, if you have more than 512MB available to allocate to the process, the following settings could be used:
This page is licensed: CC BY-SA / Gnu FDL
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.2mariadb-waitpid [options] pid timeshell> replace a b b a -- file1 file2 ...shell> resolveip mariadb.org
IP address of mariadb.org is 166.78.144.191resolveip 166.78.144.191
Host name of 166.78.144.191 is mariadb.org$install/mc ls -r local/storage-enginels $data/storage-enginemariadb-test/suite/s3/my.cnf
mariadb-test/suite/s3/slave.cnfshell> mariadb-tzinfo-to-sql timezone_dir
shell> mariadb-tzinfo-to-sql timezone_file timezone_name
shell> mariadb-tzinfo-to-sql --leap timezone_fileTRUNCATE 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 mysqlshell> mariadb-tzinfo-to-sql timezone_file timezone_name | mariadb -u root mysqlshell> mariadb-tzinfo-to-sql --leap timezone_file | mariadb -u root mysqlmariadb-dumpslow [ options... ] [ logs... ]export MTR_STOP_FILE="/path/to/stop/file"
export MTR_STOP_KEEP_ALIVE=120
mariadb-test-run.plmyisamchk
--myisam_sort_buffer_size=256M
--key_buffer_size=512M
--read_buffer_size=64M
--write_buffer_size=64M
...--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.
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 supports the following options. For options that refer to page numbers, the numbers are zero-based.
-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.
Rewriting a CRC32 checksum to replace an invalid checksum:
A count of each page type:
This page is licensed: CC BY-SA / Gnu FDL
Various cloud services: Amazon RDS, Amazon Aurora, Google Cloud, Oracle MySQL Cloud, Alibaba Cloud,
Security connections: Secure Socket Layer (SSL), Secure Shell (SSH), HTTP Tunneling, PAM Percona.
Detailed MariaDB database information, such as types, details, and properties of the objects, inter-object dependencies, and DDL codes.
Various style templates allowing for alteration of documentation layout.
HTML and PDF (searchable formats).
Markdown.
Edit or add an object description.
Download a free 30-day trial of dbForge Documenter for MariaDB and MySQL here.
Documentation is available, too.
dbForge Documenter 10.1
Support for the rds-ca-rsa2048-g1 SSL/TLS certificate for connecting to MariaDB servers on AWS and enhanced cloud compatibility features, new automation capabilities.
dbForge Documenter 10.0
Support for MariaDB 11.4. Added support for temporal tables in MariaDB.
dbForge Documenter 2.2
Support for MariaDB 11.3.
dbForge Documenter 2.1
Support for MariaDB 10.9 and 10.10.
dbForge Documenter 2.0
Connectivity support for MariaDB 10.5.
This page is licensed: CC BY-SA / Gnu FDL

mariadb-binlog utility is used to view these events in plain text.Run mariadb-binlog from a command line:
See mariadb-binlog Options for details on the available options.
Display the contents of a binary log file named mariadb-bin.000152 like this:
The logging format is determined by the value of the binlog_format system variable. If you are using statement-based logging, the output includes the SQL statement, the ID of the server the statement was executed on, a timestamp, and how much time the statement took to execute. If you are using row-based logging, the output of an event will not include an SQL statement, but will instead output how individual rows were changed.
The output from mariadb-binlog can be used as input to the mariadb client to redo the statements contained in a binary log. This is useful for recovering after a server crash (replace binlog-filename with the name of a binary log file):
If you would like to view and possibly edit the file before applying it to your database, use the -r flag to redirect the output to a file (replace outputfile with the name of a file to store the output, and binlog-filename with the name of a binary log file):
In the output file, delete any statements you don't want executed (such as an accidental DROP DATABASE). Once you are satisfied with the contents, you can execute it:
Be careful to process multiple log files in a single connection, especially if one or more of them have any CREATE TEMPORARY TABLE ... statements. Temporary tables are dropped when the mariadb client terminates, so if you are processing multiple log files one at a time (i.e. multiple connections), and one log file creates a temporary table and then a subsequent log file refers to the table, you get an 'unknown table' error.
To execute multiple log files using a single connection, list them all on the mariadb-binlog command line:
If you need to manually edit the binlogs before executing them, combine them all into a single file before processing:
mariadb-convert-table-format is written in Perl and requires that the DBI and DBD::mysql Perl modules be installed. Invoke mariadb-convert-table-format like this:
The db_name argument indicates the database containing the tables to be converted.
mariadb-convert-table-format supports the options described in the following list:
-?, --help
Display help and exit.
-e, --engine=ENGINE
Specify the storage engine that the tables should be converted to use. The default is if this option is not given.
-f, --force
Continue even if errors occur.
-h, --host=host_name
Connect to the MariaDB server on the given host. Default localhost.
-p, --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 client programs. Specifying the password on the command line is generally considered insecure.
-P, --port=port_num
The TCP/IP port number to use for the connection.
This page is licensed: CC BY-SA / Gnu FDL
aria_read_log is a tool for displaying and applying log records from an Aria transaction log.
Aria is compiled without -DIDENTICAL_PAGES_AFTER_RECOVERY which means that the table files are not byte-to-byte identical to files created during normal execution. This should be okay, except for test scripts that try to compare files before and after recovery.
As an option, you need to use at least one of -d or -a.
The following variables can be set while passed as command line options to aria_read_log, or set in the [aria_read_log] section in your file.
This page is licensed: CC BY-SA / Gnu FDL
dbForge Data Compare helps compare and synchronize data in MariaDB, MySQL, and Percona databases and scripts folders. You can find differences between your data, as it helps analyze comparison results, creates a synchronization script, and applies changes. Additionally, MariaDB data can be compared with command-line support.
Features are described in the following.
Create accurate synchronization scripts.
Synchronize asynchronous data.
Create custom scripts with execution before/after the process of data synchronization.
Get warning messages on errors during synchronization.
Automate routine synchronizations with a command line interface.
Plan routine execution with Windows Scheduler.
Support for PowerShell compatibility.
Compare data from your database with the data placed in the script folder locally.
Choose any database, connection, or script folder with the new Data Comparison Wizard.
See the data comparison results in a data result grid.
Various options for automatic mapping.
Compare customized queries.
Compare custom keys.
Tables.
Temporal tables.
Views.
BLOB data.
All popular MariaDB server versions.
MariaDB setup on Windows, Linux, FreeBSD, etc.
Various cloud services: Amazon RDS, Amazon Aurora, Google Cloud, Oracle MySQL Cloud, Alibaba Cloud.
Secure Socket Layer (SSL), Secure Shell (SSH), HTTP Tunneling, PAM Percona security connections.
Find tables by name.
Filter the comparison process results.
Enter the values of default comparison options.
Group records by type in each compared object.
Use only relevant data in your reports.
Generate comparison reports in various formats.
Download a free 30-day trial of dbForge Data Compare .
This page is licensed: CC BY-SA / Gnu FDL
dbForge Query Builder is a visual tool that helps create any sort of MariaDB queries. Queries can be drawn on a diagram.
Features are described in the following.
Export data to many popular formats.
Export data from several tables simultaneously.
Create templates for repeated operations.
Work with multiple database connections.
MariaDB query management with drag&drop functionality.
Quick script generation.
Zooming and keyboard support in a sophisticated diagram.
Preview and print diagrams.
Add and edit sub-queries visually.
MariaDB JOINs generator.
Check the syntax automatically.
Get quick information about schema objects.
Customize formatting profiles.
Execute scripts, statements and MariaDB fragments seamlessly.
Compare the results of the query visually.
Review and evaluate a query plan shown in the tree view.
Get the detailed query information.
Advanced data filters.
Browse and edit large objects in Data Viewer and Editor windows.
Fetch asynchronous data.
Data Report wizard supports building Data Reports and customizing them with a rich set of controls.
Allows users to view and analyze the data of several related database objects in a master-detail structured document. Edit data, build relationships, filter data based on specific criteria, sort data, etc. in the Design and Data views.
Let users manipulate data visually, including sorting, grouping, or filtering fields, building charts, and calculating totals.
Download a free 30-day trial of dbForge Query Builder for MariaDB .
is available, too.
This page is licensed: CC BY-SA / Gnu FDL
dbForge Schema Compare is a solution that allows for the comparison of the MariaDB database structure. With this tool, you can find the differences in MariaDB database schemas.
Features are described in the following.
Update MariaDB schemas by generating accurate synchronization scripts.
Preview sync scripts for any schema objects.
Customize the synchronization output with various options.
Get warnings on possible errors while synchronization.
Sync asynchronous structure.
Use the advantages of MariaDB backup and restore Wizards.
Create a full or partial backup.
Restore database and schedule backups with a command line interface.
Support for databases over 2Gb.
Compare the data both in two different databases and the database data with the data placed locally.
Choose any connection and script folder stored locally with the new Data Comparison Wizard.
View the comparison process results in a data grid.
Sync and compare database schemas with command line support.
Use the Windows Scheduler to automate the sync processes.
Run synchronization and schema comparison tasks with command line execution files.
Packages.
Sequences.
Filter the types of objects before the comparison.
Dismiss particular table options while comparing.
Use the Schema Comparison Wizard for switching between the Target and Source databases.
Sort and filter the compared objects.
Get a clear view of MariaDB and MySQL schema diffs in the grid.
Manage groups of compared objects.
Generate comparison results reports in HTML, Excel XML, XML for Excel.
Include specifically selected objects in your comparison report.
All MariaDB instances set up on Windows, Linux, FreeBSD, etc.
Various cloud services: Amazon RDS, Amazon Aurora, Google Cloud, Oracle MySQL Cloud, Alibaba Cloud.
Security connections: Secure Socket Layer (SSL), Secure Shell (SSH), HTTP Tunneling, PAM Percona.
Download a free 30-day trial of dbForge MariaDB and MySQL Schema Compare .
is available, too.
This page is licensed: CC BY-SA / Gnu FDL
This can be used to set the MYSQL_OPT_CONNECT_TIMEOUT parameter of mysql_options, to change the number of seconds before an unsuccessful connection attempt times out.
enable_prepare_warnings;
disable_prepare_warnings;
Normally, when running with the prepared statement protocol with warnings enabled and executing a statement that returns a result set (like SELECT), warnings that occur during the execute phase are shown, but warnings that occur during the prepare phase are ''not'' shown. The reason for this is that some warnings are returned both during prepare and execute; if both copies of warnings were shown, then test cases would show different number of warnings between prepared statement execution and normal execution (where there is no prepare phase).
The enable_prepare_warnings command changes this so that
warnings from both the prepare and execute phase are shown, regardless of
whether the statement produces a result set in the execute phase. Thedisable_prepare_warnings command reverts to the default
behaviour.
These commands only have effect when running with the prepared statement protocol (--ps-protocol) and with warnings enabled (enable_warnings). Furthermore, they only have effects for statements that return a result set (as for statements without result sets, warnings from are always shown when warnings are enabled).
The replace_regex command supports paired delimiters (like in perl, etc). If the first non-space character in the replace_regex argument is one of (, [, {, <, then the pattern should end with ), ], }, > accordingly. The replacement string can use its own pair of delimiters, not necessarily the same as the pattern. If the first non-space character in the replace_regex argument is not one of the above, then it should also separate the pattern and the replacement string and it should end the replacement string. Backslash can be used to escape the current terminating character as usual. The examples below demonstrate valid usage of replace_regex
Sometimes it is only interesting to see the output of a utility to stdout/stderr, if utility failed. In case of success , the output might be unpredictable, and contain timestamps, startup messages etc. mariadb-backup can be a good example of such utility.
mysqltest in MariaDB can helps in this situation. In the example below, the output of $XTRABACKUP is suppressed, however if exec fails, stdout and stderr both is dumped , to aid diagnostics:
This page is licensed: CC BY-SA / Gnu FDL
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:
aria_pack is a tool for compressing tables. The resulting tables are read-only, and usually about 40% to 70% smaller.
aria_pack is run as follows:
The file name is the .MAI index file. The extension can be omitted, although keeping it permits wildcards, for instance to compress all the files, such as:
aria_pack compresses each column separately. This means, when the resulting data is read, only the individual rows and columns required need to be decompressed, allowing for quicker reading.
Once a table has been packed, use (the quick and recover options) to rebuild its indexes.
mariadb-hotcopy is a Perl script that was originally written and contributed by Tim Bunce. It uses , , and cp or scp to make a database backup.
It is a fast way to make a backup of the database or single tables, but it can be run only on the same machine where the database directories are located. mariadb-hotcopy works only for backing up and tables. It runs on Unix and NetWare.
To use
MariaDB Direct Query Adapter for Power BI enables Microsoft Power BI Desktop users to remotely connect to and query their MariaDB database including on MariaDB MariaDB Cloud without downloading the entire data set to their local machine.
MariaDB Direct Query Adapter is a Microsoft certified connector for Microsoft Power BI Desktop.
Microsoft Power BI Desktop is a free business intelligence tool available as a downloadable desktop client. Built for analysts, Microsoft Power BI provides state-of-the-art interactive visualizations, with industry-leading data query and modeling built-in. It is one of the top business intelligence tools in use globally.
MariaDB database products support analytics and data warehousing in addition to transactional databases. Customers can meet the challenges from complex workloads using a single stack. MariaDB Enterprise Server includes pluggable smart storage engines to meet specific workload needs and connectors for high-performance data access by applications.
is a modern SQL editor database management toolkit.
PgManage supports MariaDB along many other databases.
Desktop or Browser-based: Runs as desktop application or can be installed as a webapp and used in a browser.
Modern Interface: The UI is optimized to be easy to use efficient to navigate.
Multiple Workspaces: Work with many database sessions at once and easily switch between them
my_print_defaults --defaults-file=example.cnf client client-server mysqlmy_print_defaults mariadb-check clientinnochecksum [options] file_nameinnochecksum --no-check --write crc32 tablename.ibdinnochecksum --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 0mariadb-binlog [options] binlog-filename [binlog-filename ...]mariadb-binlog mariadb-bin.000152mariadb-binlog binlog-filename | mysql -u root -pmariadb-binlog -r outputfile binlog-filenamemariadb -u root -p --binary-mode < outputfilenamemariadb-binlog mariadb-bin.000001 mariadb-bin.000002 | mariadb -u root -p --binary-modemariadb-binlog mariadb-bin.000001 > /tmp/mariadb-bin.sql
mariadb-binlog mariadb-bin.000002 >> /tmp/mariadb-bin.sql
# make any edits
mariadb -u root -p -e "source /tmp/mariadb-bin.sql"mariadb-convert-table-format [options] db_nameshell> mariadb-convert-table-format [options]db_name--connect-timeout=N-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.
-S, --socket=path
For connections to localhost, the Unix socket file to use.
-u, --user=user_name
The MariaDB user name to use when connecting to the server.
-v, --verbose
Verbose mode. Print more information about what the program does.
-V, --version
Display version information and exit.
Compare databases and sync different MariaDB versions.
dbForge Data Compare 10.1
Support for the rds-ca-rsa2048-g1 SSL/TLS certificate for connecting to MariaDB servers on AWS and enhanced cloud compatibility features, new automation capabilities.
dbForge Data Compare 10.0
Support for MariaDB 11.4, Added support for temporal tables in MariaDB.
dbForge Data Compare 5.9
Support for MariaDB 11.3.
dbForge Data Compare 5.8
Support for MariaDB 10.9 and 10.10.
dbForge Data Compare 5.7
Connectivity support for MariaDB 10.5.




dbForge Schema Compare 10.1
Support for the rds-ca-rsa2048-g1 SSL/TLS certificate for connecting to MariaDB servers on AWS and enhanced cloud compatibility features, new automation capabilities.
dbForge Schema Compare 10.0
MariaDB 11.4, Added support for temporal tables in MariaDB.
dbForge Schema Compare 5.2
MariaDB 11.3.
dbForge Schema Compare 5.1
MariaDB 10.9, MariaDB 10.10.
dbForge Schema Compare 5.0
MariaDB 10.5.
dbForge Schema Compare 4.4
MariaDB 10.4.













dbForge Query Builder 10.1
Support for the rds-ca-rsa2048-g1 SSL/TLS certificate for connecting to MariaDB servers on AWS and enhanced cloud compatibility features, new automation capabilities.
dbForge Query Builder 10.0
MariaDB 11.4, Implemented support for the JSON_TABLE() table function in MariaDB.
dbForge Query Builder 5.2
MariaDB 11.3.
dbForge Query Builder 5.1
MariaDB 10.9, MariaDB 10.10.
dbForge Query Builder 4.5
MariaDB 10.5.









Secure: Sensitive information like DB passwords, SSH keys etc. is stored in an encrypted form and protected by Master Password.
Schema and Table Editors: Create/alter tables and manage data using intuitive and clean UI.
Smart SQL Editor: Context-aware code completion, error annotations, powerful search and replace.
Light or Dark: Different themes to choose from.
Tabbed Workspace: Keep multiple editors and other tools open and easily switch between them.
Quick Search: Easily find an object in DB Explorer using a fuzzy search dialog.
Tunneling: Connect to your databases via SSH tunnel if it is not directly accessible.
Product Page www.commandprompt.com/products/pgmanage Github Project https://github.com/commandprompt/pgmanage
This page is licensed: CC BY-SA / Gnu FDL

-h, --aria-log-dir-path=name
Path to the directory where to store transactional log.
-P, --page-buffer-size=#
The size of the buffer used for index blocks of Aria tables.
-l, --print-log-control-file
Print the content of the aria_log_control_file.
-o, --start-from-lsn=#
Start reading log from this lsn.
-C, --start-from-checkpoint
Start applying from last checkpoint.
-s, --silent
Print less information during apply/undo phase.
-T, --tables-to-redo=name
List of comma-separated tables that we should apply REDO on. Use this if you only want to recover some tables.
-t, --tmpdir=name
Path for temporary files. Multiple paths can be specified, separated by colon (:).
--translog-buffer-size=#
The size of the buffer used for transaction log of Aria tables.
-u, --undo
Apply UNDO records to tables. Disable with --disable-undo. Defaults to on; use --skip-undo to disable.
-v, --verbose
Print more information during apply/undo phase.
-V, --version
Print version and exit.
-a, --apply
Apply log to tables.
Careful — this modifies tables! Make a backup first!
Displays a lot of information if not run with the --silent option.
--character-sets-dir=name
Directory where character sets are.
-c, --check
Used with the --display-only option, check if record is fully readable (for debugging).
-?, --help
Display help and exit.
-d, --display-only
Display brief info read from records' header.
-e, --end-lsn=#
Stop applying at this lsn. If end-lsn is used, UNDO operations are not be applied.
mariadb-hotcopySELECTRELOAD privilege (to be able to execute FLUSH TABLES), and the LOCK TABLES privilege (to be able to lock the tables).Back up tables in the given database that match a regular expression:
The regular expression for the table name can be negated by prefixing it with a tilde (~):
mariadb-hotcopy supports the following options, which can be specified on the command line or in the [mariadb-hotcopy] and [client] option file groups.
Display a help message and exit.
Do not rename target directory (if it exists); merely add files to it.
Do not abort if a target exists; rename it by adding an _old suffix.
Insert checkpoint entries into the specified database db_name and table tbl_name.
Base directory of the chroot jail in which mariadbd operates. The path value should match that of the
--chroot option given to mariadbd.
Enable debug output.
Report actions without performing them.
Flush logs after all tables are locked.
The host name of the local host to use for making a TCP/IP connection to the local server. By default, the connection is made to localhost using a Unix socket file.
Do not delete previous (renamed) target when done.
The method for copying files (cp or scp). The default is cp.
Do not include full index files for MyISAM tables in the backup. This makes the backup smaller and faster. The indexes for reloaded tables can be reconstructed later with myisamchk -rq.
Connect to old MySQL server (before MySQL 5.5) which doesn't have FLUSH TABLES WITH READ LOCK fully implemented.
The password to use when connecting to the server. The password value is mandatory 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.
The TCP/IP port number to use when connecting to the local server.
Be silent except for errors.
Record master and slave status in the specified database db_name and table tbl_name.
Copy all databases with names that match the given regular expression.
Reset the binary log after locking all the tables.
Reset the master.info file after locking all the tables.
The Unix socket file to use for connections to localhost.
The suffix string to use for names of copied databases.
The temporary directory. The default is /tmp.
The MariaDB username to use when connecting to the server.
Use perldoc for additional mariadb-hotcopy documentation, including information about the structure of the tables needed for the--checkpoint and ``--record_log_pos options:
This page is licensed: CC BY-SA / Gnu FDL
aria_read_log OPTIONS--replace_regex (/some/path)</another/path>
--replace_regex !/foo/bar!foobar!
--replace_regex {pat\}tern}/replace\/ment/i--disable_result_log
exec $XTRABACKUP --param1 --param2 # Note, do not use output redirection here
--enable_result_logshell> mariadb-hotcopy db_name [/path/to/new_directory]
shell> mariadb-hotcopy db_name_1 ... db_name_n /path/to/new_directoryshell> mariadb-hotcopy db_name./regex/shell> mariadb-hotcopy db_name./~regex/shell> perldoc mariadb-hotcopyTo 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.
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.
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.
-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.
This page is licensed: CC BY-SA / Gnu FDL
The following variables can be set as command line options to aria_pack, or set in the [ariapack] section in your my.cnf file:
-b, --backup
Make a backup of the table as table_name.OLD.
--character-sets-dir=name
Directory where character sets are located.
-h, --datadir
Path for control file (and logs if --logdir is not used).
This option is available from MariaDB 10.5.3.
-#, --debug[=name]
Output debug log. Often this is d:t:o,filename.
-?, --help
Display help and exit.
-f, --force
Force packing of table even if it gets bigger or if a temporary file exists.
To unpack a table compressed with aria_pack, use the aria_chk -u option.
This page is licensed: CC BY-SA / Gnu FDL
Enjoy the advantage of various data types support
Enjoy multiple customization options with individual generators for every data type supported
Generate consistent random data through multiple tables
Disable triggers and constraints to avoid interference with database logic
Fine-tune the way you want your data to be generated
Generate a data population script, execute it against a MariaDB database, save or edit it later
Populate tables with a great variety of values types, like JSON, Python, XML, etc.
Select any of 200+ real-world generators and populate tables with realistic data related to various spheres
Create, save and use your own data generators tailored for your needs
Enjoy real-time visualization of the alterations you make
Visually assess the data to be generated
Schedule your routine data generation tasks
Create a command line execution file for running database documentation tasks
MariaDB server versions 5.5-11.4
Various cloud services: Amazon RDS, Amazon Aurora, Google Cloud, Oracle MySQL Cloud, Alibaba Cloud
Security connections: Secure Socket Layer (SSL), Secure Shell (SSH), HTTP Tunneling, PAM Percona
Download a free 30-day trial of dbForge Data Generator here.
dbForge Data Generator 10.1
Support for the rds-ca-rsa2048-g1 SSL/TLS certificate for connecting to MariaDB servers on AWS and enhanced cloud compatibility features, new automation capabilities
dbForge Data Generator 10.0
Support for , Added support for temporal tables in MariaDB
dbForge Data Generator 2.6
Support for
dbForge Data Generator 2.5
Support for , Support for
dbForge Data Generator 2.4
Connectivity support for is added
dbForge Data Generator 2.2
Support for
This page is licensed: CC BY-SA / Gnu FDL
is a columnar storage engine designed to handle the extremely large data sets and ad hoc queries of analytical workloads. Data is written to disk by column rather than row and is automatically partitioned. Columnar data storage is designed to deliver real time analysis on billions of rows. MariaDB Enterprise ColumnStore is a plugin storage engine and is included with MariaDB Enterprise Server.
MariaDB Direct Query Adapter enables Power BI users to work with remote data without the need to download it onto the local machine. Downloading analytical data sets can present challenges such as download speed and inadequate memory on a local machine, and even a powerful laptop or desktop is outperformed by the processing power of a high end server or MPP system. MariaDB's Direct Query Adapter enables users to avoid these limitations and provides robust querying and data visualization from any location.
MariaDB Direct Query Adapter for Microsoft Power BI requires:
To use MariaDB Direct Query Adapter with Microsoft Power BI Desktop:
Download Microsoft Power BI Desktop using the Microsoft instructions.
Download MariaDB ODBC Connector.
Select MariaDB ODBC Connector v3.1.10 or later for Windows.
Click on the download or choose "Open" to start the MariaDB ODBC Connector Setup Wizard.
Click "Next".
Read and accept the terms and agreement.
Click "Next".
Choose "Typical" for installation type and click "Install".
When asked if you want to allow this app to makes changes to your device, click "Yes".
If you have older versions of MariaDB ODBC Connector 64-bit, select "Make User DSN's for older Connector version to use this version" and click "Finish". Otherwise, just click "Finish".
Connect to your remote MariaDB database from Power BI Desktop using the MariaDB Direct Query Adapter.
Open Microsoft Power BI Desktop.
From the Power BI home screen, choose Get Data->More. Enter "MariaDB". Select MariaDB from the menu and click "Connect".
Enter the data source. This is an IP address and port number, or in the case of MariaDB Cloud, it is the qualified domain name and port number.
Select "DirectQuery" and click "OK".
Enter your user name and password and click "Connect".
You are now connected to your remote MariaDB database and can use Microsoft Power BI to run queries without the need to download the data locally.
The MariaDB Direct Query Adapter for Power BI interacts with the SQL layer. It is upstream of the storage engine, so queries can be done regardless of the underlying storage engine.
For example, MariaDB Direct Query Adapter for Microsoft Power BI can be used to query data on a row-based transactional database using the InnoDB storage engines or a column-based data warehouse using the MariaDB Enterprise ColumnStore storage engine to deliver real time analysis of billions of rows of data.
Power BI depends on relationships for data analysis. These relationships are automatically established for row-based databases, for example those using the InnoDB storage engine.
Because column-based storage engines such as MariaDB Enterprise ColumnStore do not use indexes, relationships must be set up manually. For more about creating relationships in Power BI see Create and Manage Relationships in Power BI.
This page is: Copyright © 2025 MariaDB. All rights reserved.
mariadb-secure-installation is a shell script available on Unix systems, and enables you to improve the security of your MariaDB installation in the following ways:
You can set a password for root accounts.
You can remove root accounts that are accessible from outside the local host.
You can remove anonymous-user accounts.
You can remove the test database, which by default can be accessed by anonymous users.
mariadb-secure-installation can be invoked without arguments:
The script will prompt you to determine which actions to perform.
mariadb-secure-installation accepts some options:
Other unrecognized options is passed on to the server.
In addition to reading options from the command line, mariadb-secure-installation can also read options from . If an unknown option is provided to mariadb-secure-installation in an option file, it is ignored.
The following options relate to how MariaDB command-line tools handle option files. They must be given as the first argument on the command line:
mariadb-secure-installation reads options from the following from :
This script is not completely safe for use with as it directly manipulates the / table, which is not propagated by Galera to the other nodes.
You should run this script on the first node in the cluster before adding more nodes.
If you want to run this after the cluster is up and running, you should find alternative ways.
Anyone can vote for this to be fixed at .
This page is licensed: CC BY-SA / Gnu FDL
HeidiSQL is a Windows client for MariaDB and MySQL, and is bundled with the Windows version of MariaDB.
HeidiSQL 12.6
, , , , , , ,
HeidiSQL 12.3
, , , , , , ,
HeidiSQL 11.3
, , , ,
HeidiSQL 11.0
, , , , ,
HeidiSQL can:
Connect to multiple servers in one window.
Connect to servers via command line.
Create and edit tables, views, stored routines, triggers and scheduled events.
Generate nice SQL-exports.
More information, including are available at the .
This page is licensed: CC BY-SA / Gnu FDL
mariadb-stress-test is a symlink to mysql-stress-test, the script for assisting with adding users or databases or changing passwords in MariaDB.
mysql-stress-test is the symlink, and mariadb-stress-test the binary name.
mysql-stress-test is the binary name.
mariadb-stress-test.pl is a Perl script that performs stress-testing of the MariaDB server. It requires a version of Perl that has been built with threads support.
CC BY-SA / Gnu FDL
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 . 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: , .
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
mariadb-plugin [options] <plugin> ENABLE|DISABLEmariadb-plugin crazyplugins ENABLEcrazyplugins
crazyplugin1
crazyplugin2
crazyplugin3aria_pack [options] file_name [file_name2...]aria_pack *.MAI> aria_pack /my/data/test/posts
Compressing /my/data/test/posts.MAD: (1690 records)
- Calculating statistics
- Compressing file
37.71%
> aria_chk -rq --ignore-control-file /my/data/test/posts
- check record delete-chain
- recovering (with keycache) Aria-table '/my/data/test/posts'
Data records: 1690
State updated--ignore-control-file
Ignore the control file.
This option is available from MariaDB 10.5.3.
-j, --join=name
Join all given tables into name. All tables must have identical layouts.
--require-control-file
Abort if the tool cannot find the control file.
This option is available from MariaDB 10.5.3.
-s, --silent
Only write output when an error occurs.
-t, --test
Don't pack table, only test packing it.
-T, --tmpdir=name
Use temporary directory to store temporary table.
-v, --verbose
Write info about progress and packing result. Use multiple -v options for more verbosity.
-V, --version
Output version information and exit.
-w, --wait
Wait and retry if table is in use.
-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.
This page is licensed: GPLv2, originally from fill_help_tables.sql
--mysqltest=path
The path name to the mysqltest program.
--server-database=db_name
The database to use for the tests. The default is test.
--server-host=host_name
he host name of the local host to use for making a TCP/IP connection to the local server. By default, the connection is made to localhost using a Unix socket file.
--server-logs-dir=path
This option is required. path is the directory where all client session logs is stored. Usually this is the shared directory that is associated with the server used for testing.
--server-password=password
The password to use when connecting to the server.
--server-port=port_num
The TCP/IP port number to use for connecting to the server. The default is 3306.
--server-socket=file_name
For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. The default is /tmp/mysql.sock.
--server-user=user_name
The MariaDB user name to use when connecting to the server. The default is root.
--sleep-time=N
The delay in seconds between test executions.
--stress-basedir=path
This option is required and specified the path is the working directory for the test run. It is used as the temporary location for result tracking during testing.
--stress-datadir=path
The directory of data files to be used during testing. The default location is the data directory under the location given by the --stress-suite-basedir option.
--stress-init-file[=path]
file_name is the location of the file that contains the list of tests to be run once to initialize the database for the testing. If missing, the default file is stress_init.txt in the test suite directory.
--stress-mode=mode
This option indicates the test order in stress-test mode. The mode value is either random to select tests in random order or seq to run tests in each thread in the order specified in the test list file. The default mode is random.
--stress-suite-basedir=path
This option is required and specifies the directory that has the t and r subdirectories containing the test case and result files. This directory is also the default location of the stress-test.txt file that contains the list of tests. (A different location can be specified with the --stress-tests-file option.)
--stress-tests-file[=file_name]
Use this option to run the stress tests. file_name is the location of the file that contains the list of tests. If omitted, the default file is stress-test.txt in the stress suite directory. (See --stress-suite-basedir.)
--suite=suite_name
Run the named test suite. The default name is main (the regular test suite located in the mysql-test directory).
--test-count=N
The number of tests to execute before exiting.
--test-duration=N
The duration of stress testing in seconds.
--threads=N
The number of threads. The default is 1.
--verbose
Verbose mode. Print more information about what the program does
--help
Display a help message and exit.
--abort-on-error=N
Causes the program to abort if an error with severity less than or equal to N was encountered. Set to 1 to abort on any error.
--check-tests-file
Periodically check the file that lists the tests to be run. If it has been modified, reread the file. This can be useful if you update the list of tests to be run during a stress test.
--cleanup
Force cleanup of the working directory.
--log-error-details
Log error details in the global error log file.
--loop-count=N
In sequential test mode, the number of loops to execute before exiting.
-?, --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.
System error code:
MariaDB/MySQL error code:
This page is licensed: CC BY-SA / Gnu FDL
mariadb-stress-test.pl [options]perror [OPTIONS] [ERRORCODE [ERRORCODE...]]shell> perror 96
OS error code 96: Protocol family not supportedshell> 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 %luManage user-privileges.
Import text-files.
Export table rows as CSV, HTML, XML, SQL, LaTeX and Wiki Markup.
Browse and edit table-data using a comfortable grid.
Bulk edit tables (move to db, change engine, collation etc.).
Batch-insert ascii or binary files into tables.
Write queries with customizable syntax-highlighting and code-completion.
Pretty reformat disordered SQL.
Monitor and kill client-processes.
Find specific text in all tables of all databases of one server.
Optimize and repair tables in a batch manner.
HeidiSQL 10.2
, , , ,
HeidiSQL 9.5
, , , ,
HeidiSQL 9.4
, ,
HeidiSQL 9.3
, ,
HeidiSQL 9.1
, ,
HeidiSQL 8.3
,
HeidiSQL 8.0
,
HeidiSQL 7.0
,
SHOW STATUSKey_readsKey_read_requestsThis 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, archived here.
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.
--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_ in descending order (after DMS in Questions report). If N is not given, default is 3. Such non-DMS Com_ values include , , , etc.
--dms
Print Data Manipulation Statements (DMS) report (under DMS in Questions report). DMS are those from the section. mariadb-report considers only , , , , and . 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, ), 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 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.
This page is licensed: CC BY-SA / Gnu FDL
copying the shared library libmaodbc.so to /usr/lib/[multi-arch],
installing the unixodbc, unixodbc-dev, openssh-client, odbcinst packages, and
creating a template file for the .
Install the ODBC driver from the template file by running:
Verify the installation was successful in /etc/odbcinst.ini file (this path is obtained by the config info /-j/ option, where drivers are installed in that predefined location).
Create a template file for the . A sample “MariaDB_odbc_data_source_template.ini” could be:
[MariaDB-server]
Description=MariaDB server
Driver=MariaDB ODBC 3.1 Driver
SERVER=localhost
USER=anel
PASSWORD=
DATABASE=test
PORT=3306
Install data source:
Verify successful installation in the /.odbc.ini file
Verify successful installation also using the utility:
Start Libreoffice Base from the terminal by running lobase (make sure to install the libreoffice-base package if needed). The default option is to create a new database, which is HSQLDB. In order to connect to a running MariaDB server, choose “Connect to an existing database” and choose “ODBC” driver as shown below:
After that, choose DSN (the one that we created in the previous step) and click “Next”:
Provide a user name (and password if needed) and again check the connection (with the “Test Connection” button) and click “Next”:
After that, we have options to register the database. Registration in this sense means that the database is viewable by other LibreOffice modules (like LibreOffice Calc and LibreOffice Writer). So this step is optional. In this example, we will save as “fosdem21_mariadb.odb”. See Using a Registered Database.
It opens the following window:
It consists of three panels:
“Database” window with the options,
"Tables",
"Queries",
"Forms",
"Reports".
"Tasks window (dependent on what is selected in the “Database” window). When “Tables” is selected, the options are:
"Create Table in Design View",
"Use Wizard to Create Table" and
"Create View".
"Tables" window - shows list of tables that are created.
As we can see, there are system tables in the “mysql” database as well as “test” database.
Let’s say we create a table using the REST API from JSON data from posts, and another table using the same mechanism from users, and let’s call them webposts and webusers. In order to do so, we have to enable the CONNECT storage engine plugin and start with REST_API. See more in the CONNECT - Files Retrieved Using Rest Queries article.
The queries we need to run in MariaDB are:
The result in LibreOffice Base is as shown below:
Double clicking on the table opens a new window with the data displayed to inspect:
To create the table from the “Tasks” window, use the option “Create Table in Design View”, where one can specify specific field names and types as shown:
From the “Tasks” window one can create a table using the option “Use Wizard to Create Table” to create some sample tables.
One can fill the data in the existing table, or create and define the new table from the LibreOffice Calc module with simple copy-paste (in the "Tasks" window).
Other modules can use the registered database, for example, open "LibreOffice Calc" and go to "Tools", "Options" and you will see the "odb" file we registered when starting "LibreOffice Base".
This page is licensed: CC BY-SA / Gnu FDL
dbForge Data Generator 2.1
Support for
dbForge Data Generator 2.0
Support for , Support for




--basedir=dir
Base directory.
--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.
--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.
[client]
Options read by all MariaDB and MySQL client programs, which includes both MariaDB and MySQL clients like 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.
dbForge Studio for MariaDB is a universal IDE with GUI tools that has all the necessary built-in capabilities to work with MariaDB and MySQL databases for their development, management, and administration. It allows for creating, managing, and editing the data without the need to store them locally.
This GUI tool offers a rich visual design that is perfect for working with large scripts, preparing data reports, and database projects. At any time, you can back up or restore your data, export or import them to and from the most commonly used formats, and compare or synchronize the MariaDB databases.
Features are described in the following.
Automatic code completion.
MariaDB syntax highlighting.
Code refactoring and formatting.
CRUD generation.
Data and schema synchronization and comparison.
Recurring database sync tasks planning.
Comparison report generation.
MariaDB data export to commonly used formats.
Data import from popular formats into MariaDB table.
Rich customization ability.
Command-line automation for data tasks.
MariaDB databases backing up and restoring.
User accounts and permissions configuration.
Table maintenance.
Database scripts generation.
Source and Target server selection.
Database to be copied or dropped selection.
Configuration of the database copying parameters.
Progress of copying tracing and abortion of the copying.
Schema diagrams generation.
Visual database construction.
Foreign key relations between tables.
Data customization supported by multiple generators.
All kinds of generators: basic, meaningful, and user-defined.
Real-time preview of generated data.
Command-line interface.
Visual query profiling.
Profiling results comparison.
Automatic generation of the script template for queries.
Easy navigation through the database objects.
Support for different query types.
Support for sequence tables.
Table creation and editing in MariaDB with no code.
Automatic data type setting for frequently-used column values.
Errors prevention while working with tables.
MariaDB script automatic generation according to the changes made by a user.
Renaming database objects with preview.
Refactoring script.
Version control of database schemas and static table data.
Compatibility with all major version control systems.
Dedicated and shared development models.
Quick comparison of database versions.
MariaDB version control system providing efficient database team development.
Scripts folder for exporting a database project to a MariaDB script file.
Pivot tables for summarizing and viewing the data.
A powerful wizard with robust features.
Full command line support.
9 formats for reports' delivery.
A comprehensive overview of the database structure.
Examine the internal dependencies between objects and databases.
Customize the style and generate the docs in several formats.
Packages.
Sequences.
Temporal tables.
This database tool is one of the most appreciated worldwide and trusted by many people. Devart’s dbForge Studio has received a lot of awards that confirm its overwhelming popularity.
Download a free 30-day trial of dbForge Studio for MariaDB and MySQL .
is available, too.
This page is licensed: CC BY-SA / Gnu FDL
myisam_ftdump is a utility for displaying information about MyISAM FULLTEXT indexes. It will scan and dump the entire index, and can be a lengthy process.
If the server is running, make sure you run a FLUSH TABLES statement first.
myisam_ftdump <table_name> <index_num>The table_name can be specified with or without the .MYI index extension.
The index number refers to the number of the index when the table was defined, starting at zero. For example, take the following table definition:
The fulltext index is 2. The primary key is index 0, and the unique key index 1.
You can use myisam_ftdump to generate a list of index entries in order of frequency of occurrence as follows:
This page is licensed: CC BY-SA / Gnu FDL
Without a doubt, you want your backup/restore and export/import operations to be fast, easy, and automated wherever possible. You can have it all that way with . As the name implies, it is an IDE for MySQL development, management, and administration, yet it works just as perfectly as a . Now, let's see how it tackles routine database backups.
Navigating the complexities of database management requires the right tools and know-how, especially when dealing with specialized storage engines like MyISAM in MySQL and MariaDB environments. This comprehensive guide demystifies the role and functionality of MyISAM clients, offering you a deep dive into their essential features and operations. From initiating CRUD operations to optimizing table performance, we cover it all. We also spotlight dbForge Studio for MySQL, a feature-rich IDE that simplifies your interactions with MyISAM tables and databases. Whether you're a seasoned DBA or a developer looking to sharpen your database skills, this article serves as your go-to resource for understanding MyISAM clients and maximizing their capabilities.
A MyISAM client refers to a specialized application or module designed to interact with the MyISAM database storage engine. Its primary function is to facilitate essential database operations such as creating, reading, updating, and deleting data (commonly referred to as CRUD operations) through specific protocols, APIs, or query languages.
mariadb-report [options]$ sudo odbcinst -i -d -f MariaDB_odbc_driver_template.ini
odbcinst: Driver installed. Usage count increased to 1.
Target directory is /etc$ odbcinst -j
unixODBC 2.3.6
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/anel/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
$ cat /etc/odbcinst.ini
[MariaDB ODBC 3.1 Driver]
Description=MariaDB Connector/ODBC v.3.1
Driver=/usr/lib/x86_64-linux-gnu/libmaodbc.so
UsageCount=1odbcinst -i -s -h -f MariaDB_odbc_data_source_template.ini$ cat ~/.odbc.ini
[MariaDB-server]
Description=MariaDB server
Driver=MariaDB ODBC 3.1 Driver
SERVER=MariaDB
USER=anel
PASSWORD=
DATABASE=test
PORT=3306$ isql MariaDB-server
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> show tables;
+--------------------------------------------------------------------------+
| Tables_in_test |
+--------------------------------------------------------------------------+
| Authors |
| tbl_names |
| webposts |
| webusers |
+--------------------------------------------------------------------------+
SQLRowCount returns 4
4 rows fetchedCREATE TABLE webusers ENGINE=CONNECT TABLE_TYPE=JSON
HTTP='http://jsonplaceholder.typicode.com/users';
CREATE TABLE webposts ENGINE=CONNECT TABLE_TYPE=JSON
HTTP='http://jsonplaceholder.typicode.com/posts';shell> mariadb-secure-installationExample:
localhost:# mariadb-secure-installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password is blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n] n
... skipping.
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!CREATE TABLE IF NOT EXISTS `employees_example` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(30) NOT NULL,
`last_name` VARCHAR(40) NOT NULL,
`position` VARCHAR(25) NOT NULL,
`home_address` VARCHAR(50) NOT NULL,
`home_phone` VARCHAR(12) NOT NULL,
`employee_code` VARCHAR(25) NOT NULL,
`bio` text NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `employee_code` (`employee_code`),
FULLTEXT (`bio`)
) ENGINE=MyISAM;--help
Output help information and exit.
--host ADDRESS
Host address.
--infile file
Instead of getting SHOW STATUS 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: version, table_cache, max_connections, key_buffer_size, query_cache_size. 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 Query Cache report.
--sas
Print report for Select_ and Sort_ status values (after Questions report). See MySQL Select and Sort Status Variables, archived here.
--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.
History of changes.
dbForge Studio for MySQL 10.1
Support for the rds-ca-rsa2048-g1 SSL/TLS certificate for connecting to MariaDB servers on AWS and enhanced cloud compatibility features, new automation capabilities.
dbForge Studio for MySQL 10.0
Support for MariaDB 11.4, added Source Control, support for temporal tables in MariaDB.
dbForge Studio for MySQL 9.2
Support for MariaDB 11.3, enhanced code completion for application-period temporal tables, support for sequence tables in MariaDB databases
dbForge Studio for MySQL 9.1
Connectivity support for MariaDB 10.9 and 10.10.
dbForge Studio for MySQL 9.0
Connectivity support for MariaDB 10.5 and 10.6.
dbForge Studio for MySQL 8.1
Support for MariaDB 10.4.






-v, --verbose
Be verbose.
-h, --help
Display help and exit.
-?, --help
Synonym for -h.
-c, --count
Calculate per-word stats (counts and global weights).
-d, --dump
Dump index (incl. data offsets and word weights).
-l, --length
Report length distribution.
-s, --stats
Report global stats.
myisam_ftdump -c mytexttable 1 | sort -rOn the Database menu, go to Backup and Restore, and click Backup Database to open Database Backup Wizard.
On the General page, specify the required connection and database, the path for the backup file to be saved to, and the output file name in the respective fields. Optionally, you can append a timestamp to the file name, enable the auto-deletion of old files, and compress your backup into an archive. After you set it all up, click Next.
On the Backup content page, select the content for your backup and click Next.
On the Options page, configure your detailed backup options—there are quite a few of those to match your requirements most precisely. Then click Next.
On the Errors handling page, configure the Errors handling and Log settings options. Afterwards, click Backup to run the backup process.
Note that you have two more options here: you can select Save Project to save your current backup project with all the settings—or you can select Save Command Line to save a backup script that you can execute from the command line whenever you need.
After you click Backup, wait for the backup process to be completed.
Note that you don't have to go through every wizard page to click Backup. You can do it whenever you've finished configuring your settings.
Finally, confirm the successful completion by clicking Finish.
As you can see, it's very easy. Furthermore, you can schedule to run regular backups using Action > Create Basic Task in Windows Task Scheduler.
This is an even faster task, done in half as many steps.
On the Database menu, go to *Backup and Restore, and click Restore Database to open the Database Restore Wizard.
On the Database Script File page, specify the required connection and database, as well as the path to the previously saved backup file.
After that, click Restore, and let the Studio do the rest for you.
And when it's done, click Finish, and there you have it.
You can learn more about this functionality on the dedicated backup/restore page. Please note: while the page focuses on MySQL databases, everything that's described there is just as perfectly applicable to MariaDB from the same Studio with the same workflow.
With dbForge Studio, you can export data to 14 most popular formats: HTML, TXT, XLS, XLSX, MDB, RTF, PDF, JSON, XML, CSV, OBSC, DBF, SQL, and Google Sheets. You can do it with an easy-to-follow wizard that guides you through the entire process and delivers quite a few customization options.
Let's see how it works. And before we start, note that different formats may have slightly different wizard pages. In our walkthrough, we'll take the HTML format as an example.
To open the export wizard, on the Database menu, click Export Data.
On the Export format page, pick the required format and click Next.
On the Source page, select the required connection, database, as well as tables and views to be exported. Then click Next.
On the Output settings page, specify the path for the output, select to export data into a single or several separate files, and configure a few other settings, such as timestamps and compression. Then click Next.
On the Options page, configure and preview table grid options for exported data. Click Next.
On the Data formats page, you have two tabs. On the Columns tab, you can check the list of columns to be exported.
Then, on the Formats tab, you can adjust the default format settings for Date, Time, Date Time, Currency, Float, Integer, Boolean, Null String, as well as select the required binary encoding.
Once you make sure everything is correct, click Next.
On the Exported rows page, select to export all rows or define a certain range of rows, and then click Next*.**
On the Errors handling page, configure the errors handling behavior and select to keep a log file, if necessary.
But before you click Export, note that you can save templates with your settings for recurring export operations. To do that, click Save in the lower left corner of the wizard, specify a name and a destination for the template file to be saved to, and then click Save.
Also note that you don't have to go through every wizard page to click Export. You can do it whenever you've finished configuring your settings.
Finally, after you click Export, watch the progress and click Finish upon completion.
Done! Now, if you want, you can open the folder with the output file right away.
dbForge Studio supports 10 data formats for import, including TXT, XLS, XLSX, MDB, XML, JSON, CSV, ODBC, DBF, and Google Sheets. Just like with export, you have a helpful wizard at hand, whose pages may have differences, depending on the format. And let's pick a different format this time, say, the Microsoft Excel format (XLS).
To open the wizard, on the Database menu, click Import Data.
On the Source file page, choose the required format, select the file to import data from, and click Next.
On the Destination page, select the target connection and database. Then you can select to import data either to a new table or to an existing table. Click Next.
On the Options page, configure and preview table grid options for imported data. Click Next.
On the Data formats page, you have two tabs. The first tab is called Common Formats, where you can specify the required formats for null strings, thousand and decimal separators, boolean variables, date and time.
The second tab is called Column Settings, where you can configure format settings for separate columns.
Once you make sure everything is correct, click Next.
On the Mapping page, you can map the source columns to the target ones and preview the results. If you're importing data into a new table, the Studio will automatically create and map all the columns, so you will only have to make adjustments if you wish. Then click Next.
On the Modes page, select one of the 5 available import modes and click Next.
On the Output page, select the preferred output option and click Next.
On the Errors handling page, configure the errors handling behavior and select to keep a log file, if necessary.
Similarly to export, you can save templates with your settings for recurring import operations. To do that, click Save in the lower left corner of the wizard, specify a name and a destination for the template file to be saved to, and then click Save.
Also note that you don't have to go through every wizard page to click Import. You can do it whenever you've finished configuring your settings.
After you click Import, wait for the process to be completed. Then click Finish to confirm the successful completion, and check the results if you wish. That's it!
You can learn more about this functionality on the dedicated data export/import page. Please note: while the page focuses on MySQL databases, everything that's described there is just as perfectly applicable to MariaDB from the same Studio with the same workflow.
There is much more to dbForge Studio when it comes to MariaDB development and management. You can have a brief overview of its features and capabilities on the Features page.
That said, if you'd love to have a single IDE that doesn't need any 3rd-party extensions because it can perfectly deal with nearly any task on its own, feel free to download dbForge Studio for a free 30-day trial and give it a go in your daily work.
This page is licensed: CC BY-SA / Gnu FDL
In simpler terms, any MyISAM client serves as the interface that allows users to interact with MySQL/MariaDB. There is a wide range of available solutions catering to different needs, including lightweight command line utilities like myisamchk, versatile options like the MySQL Command-Line Client, and feature-rich IDEs based on graphical user interfaces, such as MySQL Workbench or dbForge Studio for MySQL.
The choice of the right client largely depends on user preferences, the specific work environment, and the tasks they need to accomplish.
To better understand the functionality of a MyISAM client, let's delve into a practical scenario where a user needs to compose and execute a query against the database and subsequently retrieve the results. Whether you opt for a command line or GUI client, the process unfolds as follows:
Step 1: Connection Setup
The client initiates a connection to a MySQL/MariaDB server using the necessary library or connector. During this setup, it provides authentication credentials and specifies the database to be accessed.
Step 2: Query Submission
The client sends SQL queries to the MySQL/MariaDB server, utilizing the appropriate database engine—in our case, MyISAM.
Note: Modern GUI-based database clients, like dbForge Studio for MySQL and MariaDB, enhance query writing by offering essential features such as code auto-completion, formatting, debugging, code snippet libraries, and visual query builders for constructing intricate queries through diagrams.
Step 3: Query Execution
The database system takes charge of parsing and executing the SQL query. When the query involves a table managed by the MyISAM storage engine, MyISAM handles the data and its storage particulars.
Step 4: Result Retrieval
Upon completing query processing, the results are transmitted back to the client. The client then handles these results as needed—whether it's displaying them to the user or employing them for further operations.
Step 5: Connection Closure
Once the interaction is finished, the client responsibly closes the connection.
Throughout this process, it's essential to note that the client does not directly engage with MyISAM or any other storage engines. Instead, it interacts with the MySQL/MariaDB server, which, in turn, utilizes MyISAM to manage data at its level.
dbForge Studio for MySQL that is also a viable MariaDB tool offers full support for all MySQL storage engines, including MyISAM, and a user-friendly graphical interface that simplifies interactions with MyISAM tables. The functionality of the Studio makes it the common choice for professionals who prefer GUI tools over command line utilities.
It includes options available in the myisamchk utility and provides many more features to cover all database-related tasks on MySQL and MariaDB, no matter which storage engine those databases use.
Speaking of MyISAM tables, it is worth mentioning some basic operations.
In dbForge Studio for MySQL, you can check the storage engine of the current database in a couple of clicks. Select the database in Database Explorer, right-click the necessary table, and select Properties from the shortcut menu. The output will present the information of the database engine among other data.
If you need to switch between database engines for some tables, you can use the standard ALTER TABLE command. dbForge Studio for MySQL allows executing SQL queries directly against the database.
To convert an InnoDB table to MyISAM, use the following command:
ALTER TABLE database_name.table_name ENGINE=MyISAM;
Img 1 – InnoDB, img 2 – MyISAM
The same ALTER TABLE command serves in the opposite situation where you want to convert MyISAM tables to InnoDB. You will need to specify ENGINE=InnoDB in that case.
MyISAM does not support foreign key constraints that are supported by InnoDB. In case you want to convert an InnoDB table having foreign keys into MyISAM, you will encounter an error. Make sure to drop those constraints before converting. There are more differences between MyISAM and InnoDB that should be considered when you deal with these two storage engines.
The primary function of myisamchk is to check, optimize, and repair MyISAM tables. This is crucial because frequent CRUD operations (CREATE, READ, DELETE, UPDATE) can lead to table corruption and a gradual decline in performance over time. dbForge Studio for MySQL includes a table maintenance tool that simplifies the process of identifying, analyzing, optimizing, and repairing tables.
To locate tables that require the administrator's attention, you can run the standard command in dbForge Studio for MySQL:
SHOW TABLE STATUS LIKE table_name;
This command provides detailed information about the table properties, including the total space occupied by the table and the total unused space (Data_length and Data_free columns, respectively). This helps users pinpoint tables that may be consuming excessive space and may be corrupted.
This way, users can identify those tables that may take up too much space and be corrupted.
After detecting the MyISAM tables that require maintenance, you can apply the Studio’s integrated table maintenance tool to those tables to fix the issues. To launch it, right-click the necessary table in Database Explorer and select Table Maintenance.
The table maintenance module offers the following options:
Analyze the table: This tool examines the key statistics of the table, helping to create more efficient query plans for optimal performance.
Optimize the table: This option allows optimizing MyISAM tables for defragmentation, improving their performance.
Check table errors: With this option, you can run diagnostic tests on tables, identifying and reporting all errors and corruption. It's worth noting that dbForge Studio provides flexible configuration for error checking, allowing users to determine the level of detail required. While a thorough scan for all possible errors may take time, it ensures that every issue is detected and reports 100% consistency.
Checksum the table: This feature checks if the table has been modified, helping to maintain data integrity.
Repair the table: This command is used to fix corrupted MyISAM tables. Applying this option may also recommend upgrading tables if necessary to rectify errors.
dbForge Studio streamlines all of these tasks with a single click. Users only need to specify the desired option and click Execute. This simplifies the process of maintaining MyISAM tables in MySQL databases.
The functionality of myisamchk is covered by one of many features available in dbForge Studio for MySQL. This multi-featured IDE offers a comprehensive toolset with flexible configuration and robust customization capacities to perform all database-related tasks in MySQL and MariaDB, no matter which database storage engine is used there. The following aspects are just several examples of the Studio's work:
SQL Development: The functionality of this software client allows the users to construct and execute SQL queries and scripts, no matter the complexity, on databases using the MyISAM storage engine.
Database Design: Users can both build database structures from scratch and modify existing ones, including creating and managing MyISAM tables and their respective indexes and keys.
Database Administration: DBAs have access to essential tools for server connection management, performance monitoring, user account and privilege administration, and optimization and repair of tables using various storage engines.
Data Management: Beyond basic data export and import tasks, dbForge Studio allows users to browse and edit data directly in the grid. You can also sort and filter data according to your specific needs.
Backup and Restore: With support for MyISAM point-in-time backup and restore, the Studio can create backups of all types and restore them as needed. This ensures the safety, consistency, and stable performance of your databases.
Navigating the complexities of MyISAM storage engines doesn't have to be a daunting task. This article has provided you with an in-depth understanding of MyISAM clients and their integral role in MySQL and MariaDB database management. We've also showcased the unparalleled utility of dbForge Studio for MySQL, a one-stop IDE that simplifies everything from CRUD operations to advanced table maintenance. If you're keen on optimizing your database management processes, there's no better time to act.
Download a 30-day free trial of dbForge Studio to experience firsthand how this comprehensive tool can elevate your database operations to new heights.
This page is licensed: CC BY-SA / Gnu FDL








The Debug Sync Facility allows placement of synchronization points in the server code by using the DEBUG_SYNC macro:
When activated, a sync point can
Emit a signal and/or
Wait for a signal
By default, all sync points are inactive. They do nothing (except to burn a couple of CPU cycles for checking if they are active).
A sync point becomes active when an action is requested for it. To do so, put a line like this in the test case file:
This activates the sync point'after_open_tables'. It requests it to emit the
signal 'opened' and wait for another thread to emit
the signal 'flushed' when the thread's execution
runs through the sync point.
For every sync point there can be one action per thread only. Every thread can request multiple actions, but only one per sync point. In other words, a thread can activate multiple sync points.
Here is an example how to activate and use the sync points:
When conn1 runs through theINSERT statement, it hits the sync point'after_open_tables'. It notices that it is active
and executes its action. It emits the signal'opened' and waits for another thread to emit the
signal 'flushed'.
conn2 waits immediately at the special sync point 'now' for another thread to emit the 'opened' signal.
A signal remains in effect until it is overwritten. Ifconn1 signals 'opened' beforeconn2 reaches 'now',conn2 will still find the'opened' signal. It does not wait in this case.
When conn2 reaches 'after_abort_locks', it signals 'flushed', which lets conn1 awake.
Normally the activation of a sync point is cleared when it has been executed. Sometimes it is necessary to keep the sync point active for another execution. You can add an execute count to the action:
This sets the signal point's activation counter to 3. Each execution decrements the counter. After the third execution the sync point becomes inactive.
One of the primary goals of this facility is to eliminate sleeps from the test suite. In most cases it should be possible to rewrite test cases so that they do not need to sleep. (But this facility cannot synchronize multiple processes.) However, to support test development, and as a last resort, sync point waiting times out. There is a default timeout, but it can be overridden:
TIMEOUT 0 is special: If the signal is not present,
the wait times out immediately.
When a wait timed out (even on TIMEOUT 0), a
warning is generated so that it shows up in the test result.
You can throw an error message and kill the query when a synchronization point is hit a certain number of times:
Or combine it with signal and/or wait:
Here the first two hits emit the signal, the third hit returns the error message and kills the query.
For cases where you are not sure that an action is taken and thus cleared in any case, you can force to clear (deactivate) a sync point:
If you want to clear all actions and clear the global signal, use:
This is the only way to reset the global signal to an empty string.
For testing of the facility itself you can execute a sync point just as if it had been hit:
The string to "assign" to the DEBUG_SYNC variable can contain:
Here '&|' means 'and/or'. This means that one of the sections separated by '&|' must be present or both of them.
With a , it can be enabled by a mysqld command line option:
'default_wait_timeout_value_in_seconds' is the default timeout for the WAIT_FOR action. If set to zero, the facility stays disabled.
The facility is enabled by default in the test suite, but can be disabled with:
Likewise the default wait timeout can be set:
The command line option influences the readable value of the system variable.
If the facility is not compiled in, the system variable does not exist.
If --debug-sync-timeout=0 the value of the variable reads as "OFF".
Otherwise the value reads as "ON - current signal: " followed by the current signal string, which can be empty.
The readable variable value is the same, regardless if read as a global or session value.
Setting the system variable requires the 'SUPER' privilege. You can never read back the
string that you assigned to the variable, unless you assign the value
that the variable already has. But that would give a parse
error. A syntactically correct string is parsed into a debug sync
action and stored apart from the variable value.
Pseudo code for a sync point:
The sync point performs a binary search in a sorted array of actions for this thread.
The SET DEBUG_SYNC statement adds a requested
action to the array or overwrites an existing action for the same sync
point. When it adds a new action, the array is sorted again.
There are quite a few places in MariaDB and MySQL where we use a synchronization pattern like this:
Here are some explanations:
thd->enter_cond() is used to register the condition
variable and the mutex in thd->mysys_var. This is
done to allow the thread to be interrupted (killed) from its
sleep. Another thread can find the condition variable to signal and
mutex to use for synchronization in this thread's THD::mysys_var.
thd->enter_cond() requires the mutex to be acquired
in advance.
thd->exit_cond() unregisters the condition variable
and mutex and releases the mutex.
If you want to have a Debug Sync point with the wait, please place it
behind enter_cond(). Only then you can safely
decide, if the wait is taken. Also you will haveTHD::proc_info correct when the sync point emits a
signal. DEBUG_SYNC sets its own proc_info, but
restores the previous one before releasing its internal mutex. As soon
as another thread sees the signal, it does also see the proc_info from
before entering the sync point. In this case it is "new_message",
which is associated with the wait that is to be synchronized.
In the example above, the wait condition is repeated before the sync point. This is done to skip the sync point, if no wait takes place. The sync point is before the loop (not inside the loop) to have it hit once only. It is possible that the condition variable is signaled multiple times without the wait condition to be true.
A bit off-topic: At some places, the loop is taken around the whole synchronization pattern:
Note that it is important to repeat the test for thd->killed afterenter_cond(). Otherwise the killing thread may kill
this thread after it tested thd->killed in the loop
condition and before it registered the condition variable and mutex inenter_cond(). In this case, the killing thread does
not know that this thread is going to wait on a condition variable. It
would just set THD::killed. But if we would not
test it again, we would go asleep though we are killed. If the killing
thread would kill us when we are after the second test, but still
before sleeping, we hold the mutex, which is registered in mysys_var.
The killing thread would try to acquire the mutex before signaling the
condition variable. Since the mutex is only released implicitly inmysql_cond_wait(), the signaling happens at the
right place. We have a safe synchronization.
When running the MariaDB test suite with the--debug-dbug command line option, the Debug Sync
Facility writes trace messages to the DBUG trace. The following shell
commands proved very useful in extracting relevant information:
It shows all executed SQL statements and all actions executed by synchronization points.
Sometimes it is also useful to see, which synchronization points have
been run through (hit) with or without executing actions. Then add"|debug_sync_point:" to the egrep pattern.
Tests may need additional synchronization mechanisms betweenDEBUG_SYNC actions, because certain combinations
of actions can result in lost signals. More specifically, once aSIGNAL action is issued, it is stored in a global variable
for any waiting threads to determine if they are depending on that signal for
continuing. However, if a subsequent action overwrites that variable before a
waiting thread is able to check against it, the original signal is lost. Examples
of actions which would change the variable state are anotherSIGNAL or a RESET. Therefore,
before issuing these commands, the test writer should verify the previous
signal has been acknowledged. The following code snippets show an
example of a problematic pattern and a potential solution.
This page is licensed: CC BY-SA / Gnu FDL
open_tables(...)
DEBUG_SYNC(thd, "after_open_tables");
lock_tables(...)































signal
A value of a global variable that persists until overwritten by a new signal. The global variable can also be seen as a "signal post" or "flag mast". Then the signal is what is attached to the "signal post" or "flag mast".
emit a signal
Assign the value (the signal) to the global variable ("set a flag") and broadcast a global condition to wake those waiting for a signal.
wait for a signal
Loop over waiting for the global condition until the global value matches the wait-for signal.
aria_chk is used to check, repair, optimize, sort and get information about Aria tables.
With the MariaDB server, you can use CHECK TABLE,REPAIR TABLE and OPTIMIZE TABLE to do similar things.
Note: aria_chk should not be used when MariaDB is running. MariaDB Server assumes that no one is changing the tables it's using.
Aria table information is stored in 2 files: the .MAI file contains base
table information and the index and the .MAD file contains the data.aria_chk takes one or more .MAI files as arguments.
The following groups are read from the my.cnf files:
[maria_chk]
[aria_chk]
The following options to handle option files may be given as the first argument:
--check is the default action for aria_chk:
When using --recover or --safe-recover' , these options are available:
The main usage of aria_chk is a fast check of all Aria tables in your system. This is faster than doing it in MariaDB, as you can allocate all free memory to the buffers.
Assuming you have a bit more than 2G free memory, the following commands, run in the MariaDB data directory, check all your tables and repairs only those that have an error:
To optimize all your tables, run this command (the --zerofill option is used here to fill up empty space with \0 which can speed up compressed backups):
In case you have a serious problem and have to use --safe-recover, run this command:
This page is licensed: CC BY-SA / Gnu FDL
The client program mariadb-test executes a test file and compares the produced output with the result file. If the files match, the test is passed; otherwise, the test has failed. This approach can be used to test any SQL statement, as well as other executables (with the exec command).
The complete process of testing is governed and monitored by the mariadb-test-run.pl driver script, or mtr for short (for convenience, mtr is created as a symbolic link to mariadb-test-run.pl). The mtr script is responsible for preparing the test environment, creating a list of all tests to run, running them, and producing the report at the end. It can run many tests in parallel, execute tests in an order which minimizes server restarts (as they are slow), run tests in a debugger or under valgrind or strace, and so on.
Test files are located in suites. A suite is a directory which contains test files, result files, and optional configuration files. The mtr script looks for suites in the mariadb-test/suite directory, and in the mariadb-test subdirectories of plugins and storage engine directories. For example, the following are all valid suite paths:
In almost all cases, the suite directory name is the suite name. A notable historical exception is the main suite, which is located directly in themariadb-test directory.
Test files have a .test extension and can be placed directly in the suite directory (for example, mariadb-test/suite/handler/interface.test) or in thet subdirectory (e.g. mariadb-test/suite/rpl/t/rpl_alter.test ormariadb-test/t/grant.test). Similarly, result files have the .result extension and can be placed either in the suite directory or in the r subdirectory.
A test file can include other files (with the source command). These included files can have any name and may be placed anywhere, but customarily they have a .inc extension and are located either in the suite directory or in the inc or include subdirectories (for example, mariadb-test/suite/handler/init.inc ormariadb-test/include/start_slave.inc).
Other files which affect testing, while not being tests themselves, are:
disabled.def
suite.opt
other *.opt files
See for details on these.
In addition to regular suite directories, mtr supports overlays. An overlay is a directory with the same name as an existing suite, but which is located in a storage engine or plugin directory. For example,storage/myisam/mariadb-test/rpl could be a myisam overlay of the rpl suite in mariadb-test/suite/rpl. Andplugin/daemon_example/mariadb-test/demo could be a daemon_example overlay of the demo suite in storage/example/mariadb-test/demo. As a special exception, an overlay of the main suite, should be called main, as in storage/pbxt/mariadb-test/main.
An overlay is like a second transparent layer in a graphics editor. It can obscure, extend, or modify the background image. Also, one may notice that an overlay is very close to a UnionFS, but implemented in perl inside mtr.
An overlay can replace almost any file in the overlaid suite, or add new files. For example, if some overlay of the main suite contains ainclude/have_innodb.inc file, then all tests that include it will see and use the overlaid version. Or, an overlay can create a t/create.opt file
(even though the main suite does not have such a file), and create.test is executed with the specified additional options.
But adding an overlay never affects how the original suite is executed. That is, mtr always executes the original suite as if no overlay was present. Additionally, it executes a combined "union" of the overlay and the original suite. When doing that, mtr takes care to avoid re-executing tests that are not changed in the overlay. For example, creating t/create.opt in
the overlay of the main suite will only cause create.test to be executed in the overlay. But creating suite.opt affects all tests — and it will cause all tests to be re-executed with
the new options.
In certain cases it makes sense to run a specific test or a group of tests several times with different server settings. This can be done using so-called combinations. Combinations are groups of settings that are used alternatively. A combinations file defines these alternatives using my.cnf syntax, for example:
All tests where this combinations file applies is run three times: Once for the combination called "row", and --binlog-format=row on the server command line, once for the "stmt" combination, and once for the "mix" combination.
More than one combinations file may be applicable to a given test file. In this case, mtr runs the test for all possible combinations of the given combinations. A test that uses replication (three combinations as above) and InnoDB (two combinations - innodb and xtradb), is run six times.
The typical mtr output looks like this:
Every test is printed as "suitename.testname", and a suite name may include an overlay name (like in main-pbxt). After the test name, mtr prints combinations that were applied to this test, if any.
A similar syntax can be used on the mtr command line to specify what tests to run:
The mtr driver has special support for MariaDB plugins.
First, on startup it copies or symlinks all dynamically-built plugins intovar/plugins. This allows one to have many plugins loaded at the same time. For example, you can load Federated and InnoDB engines together. Also, mtr creates environment variables for every plugin with the corresponding plugin name. For example, if the InnoDB engine was built, $HA_INNODB_SO is set to ha_innodb.so (or ha_innodb.dll on Windows). The test can
safely use the corresponding environment variable on all platforms to refer to a plugin file; it always has the correct platform-dependent extension.
Second, when combining server command line options (which may come from many
different sources) into one long list before starting mariadbd, mtr treats--plugin-load specially. Normal server semantics is to use the latest value of any particular option on the command line. If one starts the server with, for example, --port=2000 --port=3000, the server will use the last value for the port, that is 3000. To allow different .opt files to require
different plugins, mtr goes through the assembled server command line, and joins all --plugin-load options into one. Additionally it removes all empty--plugin-load options. For example, suppose a test is affected by three.opt files which contain, respectively:
Assuming the Example engine was not built ($HA_EXAMPLE_SO is empty), the server gets this:
Instead of this:
Third, to allow plugin sources to be simply copied into the plugin/ orstorage/ directories, and still not affect existing tests (even if new plugins are statically linked into the server), mtr automatically disables all optional plugins on server startup. A plugin is optional if it can be disabled with the corresponding --skip-XXX server command line option. Mandatory plugins, like MyISAM or MEMORY, do not have --skip-XXX options (for instance, there is no --skip-myisam option). This mtr behavior means that no plugin, statically or dynamically built, has any effect on the server unless it was explicitly enabled. A convenient way to enable a given plugin XXX for specific tests is to create a have_XXX.opt file which contains the
necessary command line options, and a have_XXX.inc file which checks whether a plugin was loaded. Then any test that needs this plugin can source the have_XXX.inc file and have the plugin loaded automatically.
mtr is first creating the server socket (master). After that, workers are created using fork().
For each worker, the run_worker() function is called, which is executing the following:
Creates a new socket to connect to server_port obtained from the master .
Initiate communication with the master using START command.
master sends first test from list of tests supplied by the user and immediately sends command
From MariaDB Server 11.8.3, you can start mtr with the --enable_serveroutput option to enable DBMS_OUTPUT messages. Disable displaying those messages with --disable_serveroutput. See for details.
A new package procedure was added, DBMS_OUTPUT.GET_LINES_RESULT(). It re-uses the SQL code fetching lines from the DBMS_OUTPUT buffer. All buffer lines are returned in a single result set. This procedure is MariaDB-specific; it does not exist in Oracle. This workaround is needed in MariaDB, instead of using the GET_LINES() function, because MariaDB does not support fetching arrays in the client-server protocol.
This page is licensed: CC BY-SA / Gnu FDL
SET DEBUG_SYNC= 'after_open_tables SIGNAL opened WAIT_FOR flushed';--connection conn1
SET DEBUG_SYNC= 'after_open_tables SIGNAL opened WAIT_FOR flushed';
send INSERT INTO t1 VALUES(1);
--connection conn2
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET DEBUG_SYNC= 'after_abort_locks SIGNAL flushed';
FLUSH TABLE t1;SET DEBUG_SYNC= 'name SIGNAL sig EXECUTE 3';SET DEBUG_SYNC= 'name WAIT_FOR sig TIMEOUT 10 EXECUTE 2';SET DEBUG_SYNC= 'name HIT_LIMIT 3';SET DEBUG_SYNC= 'name SIGNAL sig EXECUTE 2 HIT_LIMIT 3';SET DEBUG_SYNC= 'name CLEAR';SET DEBUG_SYNC= 'RESET';SET DEBUG_SYNC= 'name TEST';RESET |
<sync point name> TEST |
<sync point name> CLEAR |
<sync point name> {{SIGNAL <signal name> |
WAIT_FOR <signal name> [TIMEOUT <seconds>]}
[EXECUTE <count>] &| HIT_LIMIT <count>}--debug-sync-timeout[=default_wait_timeout_value_in_seconds]mariadb-test-run.pl ... --debug-sync-timeout=0 ...mariadb-test-run.pl ... --debug-sync-timeout=10 ...#define DEBUG_SYNC(thd, sync_point_name)
if (unlikely(opt_debug_sync_timeout))
debug_sync(thd, STRING_WITH_LEN(sync_point_name))mysql_mutex_lock(&mutex);
thd->enter_cond(&condition_variable, &mutex, new_message);
#if defined(ENABLE_DEBUG_SYNC)
if (!thd->killed && !end_of_wait_condition)
DEBUG_SYNC(thd, "sync_point_name");
#endif
while (!thd->killed && !end_of_wait_condition)
mysql_cond_wait(&condition_variable, &mutex);
thd->exit_cond(old_message);while (!thd->killed && !end_of_wait_condition)
{
mysql_mutex_lock(&mutex);
thd->enter_cond(&condition_variable, &mutex, new_message);
if (!thd->killed [&& !end_of_wait_condition])
{
[DEBUG_SYNC(thd, "sync_point_name");]
mysql_cond_wait(&condition_variable, &mutex);
}
thd->exit_cond(old_message);
}egrep 'query:|debug_sync_exec:' mysql-test/var/log/mysqld.1.traceSET DEBUG_SYNC='now SIGNAL sig';
SET DEBUG_SYNC='RESET'; # Problematic because sig can be cleared before a waiting thread can acknowledge itSET DEBUG_SYNC='now SIGNAL sig';
# Don't issue the RESET until we have proven the waiting thread has received the signal
let $wait_condition= select count(*)=0 from information_schema.processlist where state like "debug sync point%";
source include/wait_condition.inc;
SET DEBUG_SYNC='RESET'; # Now this is safemy.cnfother *.cnf files
combinations
other *.combinations files
suite.pm
*.sh files
*.require files
*.rdiff files
valgrind.supp
$ ./mtr --suite=mroonga/storage
Run all test in the mroonga/wrapper suite (found in the storage/mroonga/mysql-test/mroonga/storage directory)
TESTCASEworkerworker gets command TESTCASE and processes test case, by calling run_testcase() function which starts(/restarts if needed) the server and sends TESTRESULT (in case of restart WARNINGS command is issued to the master in case some warnings/error logs are found).
master accepts TESTRESULT command and run mtr_report_test() function which check does the test fail and also generates the new command TESTCASE if some new test case exist.
If there is no other test case master sends BYE command which gets accepted by the worker which is properly closing the connection.
$ ./mtr innodb
search for innodb test in every suite from the default list, and run all that was found.
$ ./mtr main.innodb
run the innodb test from the main suite
$ ./mtr main-pbxt.innodb
run the innodb test from the pbxt overlay of the main suite
$ ./mtr main-.innodb
run the innodb test from the main suite and all its overlays.
$ ./mtr main.innodb,xtradb
run the innodb test from the main suite, only in the xtradb combination
$ ./mtr --suite=rpl
Run all test in the rpl suite (found in the suite/rpl directory)
Annotate_rowsrowIn the binary log, each Annotate_rows event precedes the corresponding Table map event or the first of the Table map events, if there are more than one (for instance, in a case of multi-delete or insert delayed).
The following options control the behavior ofAnnotate_rows_log_event.
This option tells the master to write Annotate_rows events to the binary log. See binlog_annotate_row_events for a detailed description of the variable.
Session values allow to annotate only some selected statements:
This option tells the replica to reproduce Annotate_row events received from the master in its own binary log (sensible only when used in tandem with the log-slave-updates option).
See replicate_annotate_row_events for a detailed description of the variable.
This option tells mariadb-binlog to skip all Annotate_row events in its output (by default, mariadb-binlog prints Annotate_row events, if the binary log contains them).
This page is licensed: CC BY-SA / Gnu FDL
mariadb-test/suite/rplmariadb-test/suite/handlerstorage/example/mariadb-test/demoplugin/auth_pam/mariadb-test/pam[row]
binlog-format=row
[stmt]
binlog-format=statement
[mix]
binlog-format=mixed==============================================================================
TEST WORKER RESULT TIME (ms) or COMMENT
--------------------------------------------------------------------------
rpl.rpl_row_find_row_debug [ skipped ] Requires debug build
main-pbxt.connect [ skipped ] No PBXT engine
main-pbxt.mysqlbinlog_row [ disabled ] test expects a non-transactional engine
rpl.rpl_savepoint 'mix,xtradb' w2 [ pass ] 238
rpl.rpl_stm_innodb 'innodb_plugin,row' w1 [ skipped ] Neither MIXED nor STATEMENT binlog format
binlog.binlog_sf 'stmt' w2 [ pass ] 7
unit.dbug w2 [ pass ] 1
maria.small_blocksize w1 [ pass ] 23
sys_vars.autocommit_func3 'innodb_plugin' w1 [ pass ] 5
sys_vars.autocommit_func3 'xtradb' w1 [ pass ] 6
main.ipv6 w1 [ pass ] 131
...--plugin-load=$HA_INNODB_SO--plugin-load=$AUTH_PAM_SO--plugin-load=$HA_EXAMPLE_SO--plugin-load=ha_innodb.so:auth_pam.so--plugin-load=ha_innodb.so --plugin-load=auth_pam.so --plugin-load=master> DROP DATABASE IF EXISTS test;
master> CREATE DATABASE test;
master> USE test;
master> CREATE TABLE t1(a int);
master> INSERT INTO t1 VALUES (1), (2), (3);
master> CREATE TABLE t2(a int);
master> INSERT INTO t2 VALUES (1), (2), (3);
master> CREATE TABLE t3(a int);
master> INSERT DELAYED INTO t3 VALUES (1), (2), (3);
master> DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3
-> WHERE t1.a=t2.a AND t2.a=t3.a;
master> SHOW BINLOG EVENTS IN 'master-bin.000001';
+-------------------+------+---------------+-----------+-------------+---------------------------------------------------------------------------------+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+-------------------+------+---------------+-----------+-------------+---------------------------------------------------------------------------------+
| master-bin.000001 | 4 | Format_desc | 100 | 240 | Server ver: 5.5.20-MariaDB-mariadb1~oneiric-log, Binlog ver: 4 |
| master-bin.000001 | 240 | Query | 100 | 331 | DROP DATABASE IF EXISTS test |
| master-bin.000001 | 331 | Query | 100 | 414 | CREATE DATABASE test |
| master-bin.000001 | 414 | Query | 100 | 499 | use `test`; CREATE TABLE t1(a int) |
| master-bin.000001 | 499 | Query | 100 | 567 | BEGIN |
| master-bin.000001 | 567 | Annotate_rows | 100 | 621 | INSERT INTO t1 VALUES (1), (2), (3) |
| master-bin.000001 | 621 | Table_map | 100 | 662 | table_id: 16 (test.t1) |
| master-bin.000001 | 662 | Write_rows | 100 | 706 | table_id: 16 flags: STMT_END_F |
| master-bin.000001 | 706 | Query | 100 | 775 | COMMIT |
| master-bin.000001 | 775 | Query | 100 | 860 | use `test`; CREATE TABLE t2(a int) |
| master-bin.000001 | 860 | Query | 100 | 928 | BEGIN |
| master-bin.000001 | 928 | Annotate_rows | 100 | 982 | INSERT INTO t2 VALUES (1), (2), (3) |
| master-bin.000001 | 982 | Table_map | 100 | 1023 | table_id: 17 (test.t2) |
| master-bin.000001 | 1023 | Write_rows | 100 | 1067 | table_id: 17 flags: STMT_END_F |
| master-bin.000001 | 1067 | Query | 100 | 1136 | COMMIT |
| master-bin.000001 | 1136 | Query | 100 | 1221 | use `test`; CREATE TABLE t3(a int) |
| master-bin.000001 | 1221 | Query | 100 | 1289 | BEGIN |
| master-bin.000001 | 1289 | Annotate_rows | 100 | 1351 | INSERT DELAYED INTO t3 VALUES (1), (2), (3) |
| master-bin.000001 | 1351 | Table_map | 100 | 1392 | table_id: 18 (test.t3) |
| master-bin.000001 | 1392 | Write_rows | 100 | 1426 | table_id: 18 flags: STMT_END_F |
| master-bin.000001 | 1426 | Table_map | 100 | 1467 | table_id: 18 (test.t3) |
| master-bin.000001 | 1467 | Write_rows | 100 | 1506 | table_id: 18 flags: STMT_END_F |
| master-bin.000001 | 1506 | Query | 100 | 1575 | COMMIT |
| master-bin.000001 | 1575 | Query | 100 | 1643 | BEGIN |
| master-bin.000001 | 1643 | Annotate_rows | 100 | 1748 | DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.a=t2.a AND t2.a=t3.a |
| master-bin.000001 | 1748 | Table_map | 100 | 1789 | table_id: 16 (test.t1) |
| master-bin.000001 | 1789 | Table_map | 100 | 1830 | table_id: 17 (test.t2) |
| master-bin.000001 | 1830 | Delete_rows | 100 | 1874 | table_id: 16 |
| master-bin.000001 | 1874 | Delete_rows | 100 | 1918 | table_id: 17 flags: STMT_END_F |
| master-bin.000001 | 1918 | Query | 100 | 1987 | COMMIT |
+-------------------+------+---------------+-----------+-------------+---------------------------------------------------------------------------------+...
SET SESSION binlog_annotate_row_events=ON;
... statements to be annotated ...
SET SESSION binlog_annotate_row_events=OFF;
... statements not to be annotated ......> mariadb-binlog.exe -vv -R --user=root --port=3306 --host=localhost master-bin.000001
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#100516 15:36:00 server id 100 end_log_pos 240 Start: binlog v 4, server v 5.1.44-debug-log created 100516
15:36:00 at startup
ROLLBACK/*!*/;
BINLOG '
oNjvSw9kAAAA7AAAAPAAAAAAAAQANS4xLjQ0LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACg2O9LEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAA=
'/*!*/;
# at 240
#100516 15:36:18 server id 100 end_log_pos 331 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
SET @@session.pseudo_thread_id=1/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1
/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
DROP DATABASE IF EXISTS test
/*!*/;
# at 331
#100516 15:36:18 server id 100 end_log_pos 414 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
CREATE DATABASE test
/*!*/;
# at 414
#100516 15:36:18 server id 100 end_log_pos 499 Query thread_id=1 exec_time=0 error_code=0
use test/*!*/;
SET TIMESTAMP=1274009778/*!*/;
CREATE TABLE t1(a int)
/*!*/;
# at 499
#100516 15:36:18 server id 100 end_log_pos 567 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
BEGIN
/*!*/;
# at 567
# at 621
# at 662
#100516 15:36:18 server id 100 end_log_pos 621 Annotate_rows:
#Q> INSERT INTO t1 VALUES (1), (2), (3)
#100516 15:36:18 server id 100 end_log_pos 662 Table_map: `test`.`t1` mapped to number 16
#100516 15:36:18 server id 100 end_log_pos 706 Write_rows: table id 16 flags: STMT_END_F
BINLOG '
stjvSxNkAAAAKQAAAJYCAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
stjvSxdkAAAALAAAAMICAAAQABAAAAAAAAEAAf/+AQAAAP4CAAAA/gMAAAA=
'/*!*/;
### INSERT INTO test.t1
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO test.t1
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO test.t1
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at 706
#100516 15:36:18 server id 100 end_log_pos 775 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
COMMIT
/*!*/;
# at 775
#100516 15:36:18 server id 100 end_log_pos 860 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
CREATE TABLE t2(a int)
/*!*/;
# at 860
#100516 15:36:18 server id 100 end_log_pos 928 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
BEGIN
/*!*/;
# at 928
# at 982
# at 1023
#100516 15:36:18 server id 100 end_log_pos 982 Annotate_rows:
#Q> INSERT INTO t2 VALUES (1), (2), (3)
#100516 15:36:18 server id 100 end_log_pos 1023 Table_map: `test`.`t2` mapped to number 17
#100516 15:36:18 server id 100 end_log_pos 1067 Write_rows: table id 17 flags: STMT_END_F
BINLOG '
stjvSxNkAAAAKQAAAP8DAAAAABEAAAAAAAAABHRlc3QAAnQyAAEDAAE=
stjvSxdkAAAALAAAACsEAAAQABEAAAAAAAEAAf/+AQAAAP4CAAAA/gMAAAA=
'/*!*/;
### INSERT INTO test.t2
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO test.t2
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO test.t2
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at 1067
#100516 15:36:18 server id 100 end_log_pos 1136 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
COMMIT
/*!*/;
# at 1136
#100516 15:36:18 server id 100 end_log_pos 1221 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
CREATE TABLE t3(a int)
/*!*/;
# at 1221
#100516 15:36:18 server id 100 end_log_pos 1289 Query thread_id=2 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
BEGIN
/*!*/;
# at 1289
# at 1351
# at 1392
#100516 15:36:18 server id 100 end_log_pos 1351 Annotate_rows:
#Q> INSERT DELAYED INTO t3 VALUES (1), (2), (3)
#100516 15:36:18 server id 100 end_log_pos 1392 Table_map: `test`.`t3` mapped to number 18
#100516 15:36:18 server id 100 end_log_pos 1426 Write_rows: table id 18 flags: STMT_END_F
BINLOG '
stjvSxNkAAAAKQAAAHAFAAAAABIAAAAAAAAABHRlc3QAAnQzAAEDAAE=
stjvSxdkAAAAIgAAAJIFAAAQABIAAAAAAAEAAf/+AQAAAA==
'/*!*/;
### INSERT INTO test.t3
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# at 1426
# at 1467
#100516 15:36:18 server id 100 end_log_pos 1467 Table_map: `test`.`t3` mapped to number 18
#100516 15:36:18 server id 100 end_log_pos 1506 Write_rows: table id 18 flags: STMT_END_F
BINLOG '
stjvSxNkAAAAKQAAALsFAAAAABIAAAAAAAAABHRlc3QAAnQzAAEDAAE=
stjvSxdkAAAAJwAAAOIFAAAQABIAAAAAAAEAAf/+AgAAAP4DAAAA
'/*!*/;
### INSERT INTO test.t3
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO test.t3
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at 1506
#100516 15:36:18 server id 100 end_log_pos 1575 Query thread_id=2 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
COMMIT
/*!*/;
# at 1575
#100516 15:36:18 server id 100 end_log_pos 1643 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
BEGIN
/*!*/;
# at 1643
# at 1748
# at 1789
# at 1830
# at 1874
#100516 15:36:18 server id 100 end_log_pos 1748 Annotate_rows:
#Q> DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3
#Q> WHERE t1.a=t2.a AND t2.a=t3.
#100516 15:36:18 server id 100 end_log_pos 1789 Table_map: `test`.`t1` mapped to number 16
#100516 15:36:18 server id 100 end_log_pos 1830 Table_map: `test`.`t2` mapped to number 17
#100516 15:36:18 server id 100 end_log_pos 1874 Delete_rows: table id 16
#100516 15:36:18 server id 100 end_log_pos 1918 Delete_rows: table id 17 flags: STMT_END_F
BINLOG '
stjvSxNkAAAAKQAAAP0GAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
stjvSxNkAAAAKQAAACYHAAAAABEAAAAAAAAABHRlc3QAAnQyAAEDAAE=
stjvSxlkAAAALAAAAFIHAAAAABAAAAAAAAAAAf/+AQAAAP4CAAAA/gMAAAA=
### DELETE FROM test.t1
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### DELETE FROM test.t1
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### DELETE FROM test.t1
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
stjvSxlkAAAALAAAAH4HAAAQABEAAAAAAAEAAf/+AQAAAP4CAAAA/gMAAAA=
'/*!*/;
### DELETE FROM test.t2
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### DELETE FROM test.t2
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### DELETE FROM test.t2
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at 1918
#100516 15:36:18 server id 100 end_log_pos 1987 Query thread_id=1 exec_time=0 error_code=0
SET TIMESTAMP=1274009778/*!*/;
COMMIT
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mariadb-binlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;--require-control-file
Abort if we can't find/read the maria_log_control file.
-s, --silent
Only print errors. You can use two -s options to make aria_chk very silent.
-t, --tmpdir=path
Path for temporary files. Multiple paths can be specified, separated by colon (:) on Unix or semicolon (;) on Windows. They are used in a round-robin fashion.
-v, --verbose
Print more information. This can be used with --description and --check. Use many -v options for more verbosity.
-V, --version
Print version and exit.
-w, --wait
Wait if table is locked.
-m, --medium-check
Faster than extend-check, and finds 99.99% of all errors. Should be good enough for most cases.
-U, --update-state
Mark tables as crashed if any errors were found and clean if check didn't find any errors but table was marked as 'not clean' before. This allows one to get rid of warnings like 'table not properly closed'. If table was updated, update also the timestamp for when the check was made. This option is on by default! Use --skip-update-state to disable.
-T, --read-only
Don't mark table as checked.
--max-record-length=#
Skip rows bigger than this if aria_chk can't allocate memory to hold it.
-r, --recover
Can fix almost anything except unique keys that aren't unique.
-n, --sort-recover
Forces recovering with sorting even if the temporary file would be very big.
-p, --parallel-recover
Uses the same technique as -r and -n , but creates all the keys in parallel, in different threads.
-o, --safe-recover
Uses an old recovery method, which is slower than using -r but can handle a couple of cases where -r reports that it can't fix the data file.
--transaction-log
Log repair command to transaction log. This is needed if one wants to use the maria_read_log option to repeat the repair.
--character-sets-dir=...
Directory where character sets are.
--set-collation=name
Change the collation used by the index.
-q, --quick
Faster repair by not modifying the data file. One can give a second '-q' to force aria_chk to modify the original datafile in case of duplicate keys.
Note: Tables with a corrupted ´ data file can't be fixed with this option.
-u, --unpack
Unpack file packed with .
-b, --block-search=#
Find a record, a block at given offset belongs to.
-z, --zerofill
Remove transaction id's from the data and index files and fills empty space in the data and index files with zeroes. Zerofilling makes it possible to move the table from one system to another without the server having to do an automatic zerofill. It also allows one to compress the tables better if one want to archive them.
--zerofill-keep-lsn
Like --zerofill but does not zero out LSN of data/index pages.
--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.
-#, --debug=...
Output debug log. Often this is d:t:o,filename.
-H, --HELP
Display this help and exit.
-?, --help
Display this help and exit.
--datadir=path
Path for control file (and logs if the --logdir option is not used).
--ignore-control-file
Don't open the control file.
Use this only if you are sure the tables are not used by another program.
--logdir=path
Path for log files.
-c, --check
Check table for errors.
-e, --extend-check
Check the table very throughly. Only use this in extreme cases, as aria_chk should normally be able to find out if the table is okay, even without this switch.
-F, --fast
Check only tables that haven't been closed properly.
-C, --check-only-changed
Check only tables that have changed since last check.
-f, --force
Restart with -r if there are any errors in the table. States is updated as with --update-state.
-i, --information
Print statistics information about table that is checked.
-B, --backup
Make a backup of the .MAD file as filename-time.BAK'.
--correct-checksum
Correct checksum information for table.
-D, --data-file-length=#
Max length of data file (when recreating data file when it's full).
-e, --extend-check
Try to recover every possible row from the data file Normally this will also find a lot of garbage rows; Don't use this option if you are not totally desperate.
-f, --force
Overwrite old temporary files.
-k, --keys-used=#
Tell MariaDB to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts.
-a, --analyze
Analyze distribution of keys. Will make some joins in MariaDB faster. You can check the calculated distribution by using --description --verbose`` table_name'.
--stats_method=name
Specifies how index statistics collection code should treat NULLs. Possible values of name are "nulls_unequal" (default for 4.1/5.0), "nulls_equal" (emulate 4.0), and "nulls_ignored".
-d, --description
Prints some information about table.
-A, --set-auto-increment[=value]
Force auto_increment to start at this or higher value If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.
-S, --sort-index
Sort index blocks. This speeds up 'read-next' in applications.
-R, --sort-records=#
Sort records according to an index. This makes your data much more localized and may speed up things (It may be VERY slow to do a sort the first time!).
page_buffer_size
Size of page buffer. Used by --safe-repair.
read_buffer_size
Read buffer size for sequential reads during scanning.
write_buffer_size
Write buffer size for sequential writes during repair of fixed size or dynamic size rows.
sort_buffer_size
Size of sort buffer. Used by --recover.
sort_key_blocks
Internal buffer for sorting keys. Do not use!
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).
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.
mariadb-show supports the following options:
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:
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.
mariadb-show reads options from the following from :
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
The mariadb-test framework utilizes many other files that affect the testing process, in addition to test and result files.
disabled.def fileThis file can be used to disable certain tests temporarily. For example, if one test fails and you are working on that, you may want to push the changeset that disables the test into the test suite so that other tests won't be disturbed by this failure.
The file contains test names and a comment (that should explain why the test
was disabled), separated by a colon. Lines that start with a hash sign
(#) are ignored. A typical disabled.def may look like this (note
that a hash sign in the middle of a line does not start a comment):
During testing, mtr will print disabled tests like this:
This file should be located in the suite directory.
suite.opt fileThis file lists server options that is added to the mariadbd command
line for every test of this suite. It can refer to environment variables with
the $NAME syntax. Shell meta-characters should be quoted. For example
Note that options may be put either on one line or on separate lines. It is a
good idea to start an option name with the --loose- prefix if
the server may or may not recognize the option depending on the configuration.
An unknown option in the .opt file will stop the server from starting, and
the test is aborted.
This file should be located in the suite directory.
*.opt filesFor every test or include file somefile.test or somefile.inc, mtr will
look for somefile.opt, somefile-master.opt and somefile-slave.opt.
These files have exactly the same syntax as the suite.opt above. Options
from these files will also be added to the server command line (all servers
started for this test, only master, or only slave respectively) for all
affected tests, for example, for all tests that include somefile.inc
directly or indirectly.
A typical usage example is include/have_blackhole.inc andinclude/have_blackhole.opt. The latter contains the necessary command line
options to load the Blackhole storage engine, while the former verifies that
the engine was really loaded. Any test that needs the Blackhole engine needs
only to start from source include/have_blackhole.inc; and the engine will
be automatically loaded for the test.
my.cnf fileThis is not the my.cnf file that tests from this suite will use, but rather
a template of it. It is converted later to an actual my.cnf. If a
suite contains no my.cnf template, a default template,
— include/default_my.cnf
— is used. Or suite/rpl/my.cnf if the test
includes master-slave.inc (it's one of the few bits of the old MySQLmysql-test-run magic that we have not removed yet). Typically a suite
template will not contain a complete server configuration, but rather start
from
and then add the necessary modifications.
The syntax of my.cnf template is the same of a normal my.cnf file, with
a few extensions and assumptions. They are:
For any group with the name [mysqld.N], where N is a number, mtr
will start one mysqld process. Usually one needs to have
only [mysqld.1] group, and [mysqld.2] group for replication tests.
There can be groups with non-standard names ([foo], [bar], whatever),
not used by mysqld. The suite.pm
it sets the value of the master-port in the [mysqld.2] group to the value of port in the [mysqld.1] group.
An option name may start with a hash sign #. In the
resulting my.cnf it will look like a comment, but it still can be
referred to. For example:
There is the [ENV] group. It sets values for the environment variables.
For example
Also, one can refer to values of environment variables via this group:
There is the [OPT] group. It allows to invoke functions and
generate values. Currently it contains only one option
— @OPT.port. Every time this option is referred
to in some other group in the my.cnf template, a new unique port number
is generated. It will not match any other port number used by this test run.
For example
This file should be located in the suite directory.
*.cnf filesFor every test file somefile.test (but for not included files) mtr will
look for somefile.cnf file. If such a file exists, it is used as a
template instead of suite my.cnf or a default include/default_my.cnf
templates.
combinations fileThe combinations file defines few sets of alternative configurations, and
every test in this suite is run many times - once for every configuration.
This can be used, for example, to run all replication tests in the rpl
suite for all three binlog format modes (row, statement, and mixed). A
corresponding combinations file would look as
following:
It uses my.cnf file syntax, with groups (where group names define
combination names) and options. But, despite the similarity, it is not amy.cnf template, and it cannot use the templating extentions. Instead,
options from the combinations file are added to the server command line. In
this regard, combination file is closer to suite.opt file. And just like
it, combination file can use environment variables using the $NAME syntax.
Not all tests will necessarily run for all combinations. A particular test may
require to be run only in one specific combination. For example, in
replication, if a test can only be run with the row binlog format, it will have--binlog-format=row in one of the .opt files. In this case, mtr will
notice that server command line already has an option that matches one of the
combinations, and will skip all other combinations for this particular test.
The combinations file should be located in the suite directory.
*.combinations filesJust like with the *.opt files, mtr will use somefile.combinations file
for any somefile.test and somefile.inc that is used in testing. These
files have exactly the same format as a suite combinations file.
This can cause many combination files affecting one test file (if a test
includes two .inc files, and both of them have corresponding.combinations files). In this case, mtr will run the test for all
combinations of combinations from both files. In , for example,rpl_init.inc adds combinations for row/statement/mixed, andhave_innodb.inc adds combinations for innodb/xtradb. Thus any replication
test that uses innodb is run six times.
suite.pm fileThis (optional) file is a perl module. It must declare a
package that inherits from My::Suite.
This file must normally end with bless {} — that
is it must return an object of that class. It can also return a string
— in this case all tests in the suite is skipped,
with this string being printed as a reason (for example "PBXT engine was not
compiled").
A suite class can define the following methods:
config_files()
is_default()
list_cases()
servers()
A config_files() method returns a list of additional config files (besidesmy.cnf), that this suite needs to be created. For every file it specifies a
function that will create it, when given a My::Config object. For example:
A servers() method returns a list of processes that needs to be started for
this suite. A process is specified as a [regex, hash] pair. The regular
expression must match a section in the my.cnf template (for example,qr/mysqld\./ corresponds to all mysqld processes), the hash contains
these options:
See the sphinx suite for a working example.
A list_cases() method returns a complete list of tests for this suite. By
default it is the list of files that have .test extension, but without
the extension. This list is filtered by mtr, subject to different mtr
options (--big-test, --start-from, etc), the suite object does not have
to do it.
A start_test() method starts one test process, by default it ismariadb-test. See the unit suite for a working example oflist_cases() and start_test() methods.
A skip_combinations() method returns a hash that maps file names (where
combinations are defined) to a list of combinations that should be skipped. As
a special case, it can disable a complete file by using a string instead of a
hash. For example
The last line will cause all tests of this suite that include windows.inc
to be skipped with the reason being "Not on windows".
An is_default() method returns 1 if this particular suite should be run by default, when the mariadb-test-run.pl script is run without explicitly specified test suites or test cases.
*.sh filesFor every test file sometest.test mtr looks for sometest-master.sh andsometest-slave.sh. If either of these files is found, it is run before
the test itself.
*.require filesThese files are obsolete. Do not use them anymore. If you need to skip a test
use the skip command instead.
*.rdiff filesThese files also define what the test result should be. But unlike *.result
files, they contain a patch that should be applied to one result file to create
a new result file. This is very useful when a result of some test in one
combination differs slightly from the result of the same test, but in another
combination. Or when a result of a test in an overlay differs from the test
result in the overlayed suite.
It is quite difficult to edit .rdiff files to update them after the test
file has changed. But luckily, it is never needed. When a test fails, mtr
creates a .reject file. Having it, one can create .rdiff file as easy
as (for example)
Some example:
Note: This will also add a timestamp in the .rdiff file, so if you are submitting a patch you could remove it manually. If the same .rdiff file is used for multiple combinations, then it would be good to omit in the header that would identify the combination, to allow git to pack the repository better. Example:
Because a combination can be part of the .result or .rdiff file name,
mtr has to look in many different places for a test result. For example,
consider a test foo.test in the combination pair aa,bb, that is run
in the overlay rty of the suite qwe, in other words, for the test that
mtr prints as
For this test a result can be in
either .rdiff or .result file
either in the overlay "rty/" or in the overlayed suite "qwe/"
with or without combinations in the file name (",a", ",b
which means any of the following 15 file names can be used:
rty/r/foo,aa,bb.result
rty/r/foo,aa,bb.rdiff
qwe/r/foo,aa,bb.result
qwe/r/foo,aa,bb.rdiff
They are listed, precisely, in the order of preference, and mtr will walk that list from top to bottom and the first file that is found is used.
If this found file is a .rdiff, mtr continues walking down the list until
the first .result file is found. A .rdiff is applied to that.result.
valgrind.supp fileThis file defines valgrind suppressions, and it is used when mtr is started
with a --valgrind option.
This page is licensed: CC BY-SA / Gnu FDL
aria_chk [OPTIONS] aria_tables[.MAI]aria_chk --check --sort_order --force --sort_buffer_size=1G */*.MAIaria_chk --analyze --sort-index --page_buffer_size=1G --zerofill */*.MAIaria_chk --safe-recover --zerofill --page_buffer_size=2G */*.MAImariadb-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.
Values can refer to each other using the syntax @groupname.optionname
— these references be expanded as needed. For
example
skip_combinations()
start_test()
,a,brty/r/foo,aa.result
rty/r/foo,aa.rdiff
qwe/r/foo,aa.result
qwe/r/foo,aa.rdiff
rty/r/foo,bb.result
rty/r/foo,bb.rdiff
qwe/r/foo,bb.result
qwe/r/foo,bb.rdiff
rty/r/foo.result
rty/r/foo.rdiff
qwe/r/foo.result
SORT
a number. Processes are started in the order of increasing SORT values (and stopped in the reverse order). mysqld has number 300.
START
a function to start a process. It takes two arguments, My::Config::Group and My::Test. If START is undefined a process will not be started.
WAIT
a function to wait for the process to be started. It takes My::Config::Group as an argument. Internally mtr first invokes START for all processes, then WAIT for all started processes.
mariadb-import loads tables from text files in various formats.
mariadb-import loads tables from text files in various formats. The base name of the text file must be the name of the table that should be used. If one uses sockets to connect to the MariaDB server, the server will open and read the text file directly. In other cases the client will open the text file. The SQL statement LOAD DATA INFILE is used to import the rows.
The command to use mariadb-import and the general syntax is:
mariadb-import supports the following options:
--character-sets-dir=directoryDirectory for character set files.
-c cols, --columns=colsUse only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to .
-C, --compressUse compression in server/client protocol.
--database=databaseRestore the specified database, ignoring others.To specify more than one database to include, use the directive multiple times, once for each database. Only takes effect when used together with the --dir option. This option is available from MariaDB 11.6.
--debug[=options]Output debug log. Often this is d:t:o,filename. The default is d:t:o.
--debug-checkCheck memory and open file usage at exit.
--debug-infoPrint some debug info at exit.
--default-auth=pluginDefault authentication client-side plugin to use.
--default-character-set=character-setSet the default .
--defaults-extra-file=fileRead this file after the global files are read. Must be given as the first option.
--defaults-file=fileOnly read default options from the given file name Must be given as the first option.
--defaults-group-suffix=group-suffixIn addition to the given groups, also read groups with this suffix.
-d, --deleteFirst delete all rows from table.
--dir=directoryRestore all tables from backup directory created using . This option is available from MariaDB 11.6.
--fields-terminated-by=stringFields in the input file are terminated by the given string.
--fields-enclosed-by=characterFields in the import file are enclosed by the given character.
--fields-optionally-enclosed-by=characterFields in the input file are optionally enclosed by the given character.
--fields-escaped-by=characterFields in the input file are escaped by the given character.
-f, --forceContinue even if we get an SQL error.
-?, --helpDisplay this help and exits.
-h host, --host=hostConnect to host.
-i, --ignoreIf duplicate unique key was found, keep old row.
-k, --ignore-foreign-keysDisable foreign key checks while importing the data.
--ignore-database=databaseDo not restore the specified database. To specify more than one database to ignore, use the directive multiple times, once for each database. Only takes effect when used together with the --dir option. This option is available from MariaDB 11.6.
--ignore-lines=nIgnore first n lines of data infile.
--ignore-table=tableDo not restore the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names, for instance, --ignore-table=database.table. Only takes effect when used together with the --dir option. This option is available from MariaDB 11.6.
--innodb-optimize-keysCreate secondary indexes after data load, which speeds up loading (InnoDB only). Defaults to on; use
--skip-innodb-optimize-keys to disable. This option is available from MariaDB 11.8.
--lines-terminated-by=stringLines in the input file are terminated by the given string.
-L, --localRead all files through the client.
-l, --lock-tablesLock all tables for write (this disables threads).
--low-priorityUse LOW_PRIORITY when updating the table.
--no-defaultsDon't read default options from any option file. Must be given as the first option.
-j, --parallel=numberNumber of LOAD DATA jobs executed in parallel. This option is available from MariaDB 11.4.1. --use-threads is a synonym.
-ppassword, --passwordpasswordPassword to use when connecting to server. If password is not given, it's asked from the terminal. 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.
--pipe, -Wn Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections.
--plugin-dirDirectory for client-side plugins.
-P port-number, --port=port-numberPort number to use for connection or 0 for default to, in order of preference, my.cnf, the MYSQL_TCP_PORT , /etc/services. Default is 3306.
--print-defaultsPrint the program argument list and exit. Must be given as the first option.
--protocol=protocolThe protocol to use for connection (tcp, socket, pipe, memory).
-r, --replaceIf duplicate unique key was found, replace old row.
--shared-memory-base-nameShared-memory name to use for Windows connections using shared memory to a local server (started with the --shared-memory option). Case sensitive.
-s, --silentSilent mode. Produce output only when errors occur.
-S, --socket={socket|named-pipe}For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
--sslEnables . 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=pem-fileDefine 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=pem-directoryDefine 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 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 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=fileDefine a path to the X509 certificate file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
--ssl-cipher=cipher-listList of permitted ciphers or cipher suites to use for . This option implies the --ssl option.
--ssl-crl=pem-fileDefines 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=pem-directoryDefine 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=key-fileDefine a path to a private key file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
--ssl-verify-server-certEnable . This option is disabled by default.
--table=tableRestore the specified table ignoring others. Use --table=dbname.tablename with this option. To specify more than one table to include, use the directive multiple times, once for each table. Only takes effect when used together with the --dir option. This option is available from MariaDB 11.6.
--tls-version=tls-listThis 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.
--use-threads=numberLoad files in parallel. The argument is the number of threads to use for loading data. From , a synonym for -j, --parallel=num.
-u username, --user=usernameUser for login if not current user.
-v, --verbosePrint info about the various stages.
-V, --versionOutput version information and exit.
In addition to reading options from the command line, mariadb-import can also read options from . If an unknown option is provided to mariadb-import 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:
mariadb-import is linked with MariaDB Connector/C. Therefore, it may be helpful to see for more information on how MariaDB Connector/C handles option files.
mariadb-import reads options from the following from :
This page is licensed: CC BY-SA / Gnu FDL
mariadb-slap is a tool for load-testing MariaDB. It allows you to emulate multiple concurrent connections, and run a set of queries multiple times.
Prior to , the client was called mysqlslap. It can still be accessed under this name, via a symlink in Linux, or an alternate binary in Windows.
It returns a benchmark including the following information:
Average number of seconds to run all queries;
Minimum number of seconds to run all queries;
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 | |
+-----------+-----------------------+-------------------+------+-----+---------+----------------+--------------------------------+---------+# List of disabled tests
# test name : comment
rpl_redirect : Fails due to bug#49978
events_time_zone : need to fix the timing...
rpl.rpl_redirect [ disabled ] Fails due to bug#49978
rpl.events_time_zone [ disabled ] need to fix the timing
...--plugin-load=$AUTH_PAM_SO
--max-connections=40 --net_read_timeout=5
"--replicate-rewrite-db=test->rewrite"!include include/default_my.cnf[mysqld.2]
master-port= @mysqld.1.port[example]
#location = localhost:@mysqld.1.port
bar = server:@example.#location/data[ENV]
MASTER_MYPORT = @mysqld.1.port[mysqld.1]
user = @ENV.LOGNAME[ENV]
SPHINXSEARCH_PORT = @OPT.port[row]
binlog-format=row
[stmt]
binlog-format=statement
[mix]
binlog-format=mixedsub config_files {(
'config.ini' => \&write_ini,
'new.conf' => \&do_new
)}sub servers {(
qr/^foo$/ => { SORT => 200, # start foo before mysqld
START => \&start_foo,
WAIT => \&wait_foo }
)}sub skip_combinations {(
'combinations' => [ 'mix', 'rpl' ],
'inc/many.combinations' => [ 'a', 'bb', 'c' ],
'windows.inc' => "Not on windows",
)}diff -u main/foo.result main/foo.reject > main/foo,comb.rdiff
or
diff -u main/foo.result main/foo,comb.reject > main/foo,comb.rdiffdiff -u main/innodb_ext_key.result main/innodb_ext_key,off.reject > main/innodb_ext_key,off.rdiff
diff -u suite/sys_vars/r/sysvars_server_notembedded.result suite/sys_vars/r/sysvars_server_notembedded,32bit.reject > suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff--- testname.result
+++ testname.rejectqwe-rty.foo 'aa,bb' [ pass ]delete
FALSE
fields-terminated-by
(No default value)
fields-enclosed-by
(No default value)
fields-optionally-enclosed-by
(No default value)
fields-escaped-by
(No default value)
force
FALSE
host
(No default value)
ignore
FALSE
ignore-lines
0
lines-terminated-by
(No default value)
local
FALSE
lock-tables
FALSE
low-priority
FALSE
port
3306
replace
FALSE
silent
FALSE
socket
/var/run/mysqld/mysqld.sock
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
use-threads
0
user
(No default value)
verbose
FALSE
--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.
[mysqlimport]
Options read by mysqlimport, which includes both MariaDB Server and MySQL Server.
[mariadb-import]
Options read by mysqlimport.
[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.
character-sets-dir
(No default value)
default-character-set
latin1
columns
(No default value)
compress
FALSE
debug-check
FALSE
debug-info
FALSE
You should run mariadb-upgrade after upgrading from one major MySQL/MariaDB release to another, such as from MySQL 5.0 or MariaDB 10.4 to MariaDB 10.5. You also have to use mariadb-upgrade after a direct "horizontal" migration, for example from MySQL 5.5.40 to MariaDB 5.5.40. It's also safe to run mariadb-upgrade for minor upgrades, as, if there are no incompatibilities, nothing is changed.
mariadb-upgrade needs to be run as a user with write access to the data directory.
Starting from mariadb-upgrade 2.0, the user running the upgrade tool must have write access to datadir/mysql_upgrade_info, so that the tool can write the current MariaDB version into the file.
mariadb-upgrade needs to be run as a user with write access to the data directory.
mariadb-upgrade is run after starting the new MariaDB server. Running it before you shut down the old version will not hurt anything and will allow you to make sure it works and figure out authentication for it ahead of time.
It is recommended to make a backup of all databases before running mariadb-upgrade.
In most cases, mariadb-upgrade should just take a few seconds. The main work of mariadb-upgrade is to:
Update the system tables in the mysql database to the latest version (normally just add new fields to a few tables).
Check that all tables are up to date (runs CHECK TABLE table_name FOR UPGRADE). For tables that are not up to date, runs ALTER TABLE table_name FORCE on the table to update it. A table is not up to date in the following cases:
The table uses an index for which there has been a collation change (rare).
A format change in the storage engine requires an update (very rare).
If you skip running mariadb-upgrade, issues can arise, including these:
Errors in the error log that some system tables don't have all needed columns.
Updates or searches may not find the record they are attempting to update or search for.
CHECKSUM TABLE may report the wrong checksum for MyISAM or Aria tables.
The error message "Cannot load from mysql.proc. The table is probably corrupted."
To fix issues like this, run mariadb-upgrade, mariadb-check, CHECK TABLE and, if needed, REPAIR TABLE on the faulty table.
Starting from mariadb-upgrade 2.0, mysql-upgrade doesn't run when upgrading to a new minor version (for instance, from MariaDB 10.6.3 to 10.6.4).
This includes updating from Community Server to Enterprise Server.
In those cases, mariadb-upgrade terminates with a message like this:
As the message indicates, use the --force option to override this behavior.
When upgrading from, say, Community Server 10.11.4 to Enterprise Server 10.11.11, mariadb-upgrade considers that a minor-version upgrade, so you must use the --force option to make it run.
mariadb-upgrade is mainly a framework to call mariadb-check. mariadb-upgrade works by doing the following operations:
The connect options given to mariadb-upgrade are passed along to mariadb-check and mariadb command-line client.
The mysql_fix_privilege_tables script is not called; it's included as part of mariadb-upgrade .
If you have a problem with mariadb-upgrade, try running it in very verbose mode:
mariadb-upgrade also saves the MariaDB version number in a file named mysql_upgrade_info in the data directory. This is used to quickly check whether all tables have been checked for this release so that table-checking can be skipped. For this reason,mariadb-upgrade needs to be run as a user with write access to the data directory. To ignore this file and perform the check regardless, use the --force option.
mariadb-upgrade supports the following options:
Display this help message and exit.
Old option accepted for backward compatibility but ignored.
Old option accepted for backward compatibility but ignored.
Do a quick check if upgrade is needed. Returns 0 if an upgrade is needed, 1 if not. Available from mariadb-upgrade 2.0.
Old option accepted for backward compatibility but ignored.
Old option accepted for backward compatibility but ignored.
Check memory and open file usage at exit.
Print some debug info at exit.
Old option accepted for backward compatibility but ignored.
Force execution of mariadb-check even if mariadb-upgrade has already been executed for the current version of MariaDB. Ignores mysql_upgrade_info.
Connect to MariaDB on the given host.
Password to use when connecting to server. If password is not given, it's solicited on the command line (which should be considered insecure). You can use an option file to avoid giving the password on the command line.
Port number to use for connection or 0 for default to, in order of preference, my.cnf, the MYSQL_TCP_PORT environment variable, /etc/services, built-in default (3306).
The protocol to use for connection (tcp, socket, pipe, memory).
Print less information.
For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
Enables TLS. TLS is also enabled even without setting this option when certain other TLS options are set. The --ssl option does not enable verifying the server certificate by default. In order to verify the server certificate, you must specify the --ssl-verify-server-cert option.
Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for TLS. This option requires that you use the absolute path, not a relative path. See Secure Connections Overview: Certificate Authorities (CAs) for more information. This option implies the --ssl option.
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 openssl rehash command. See Secure Connections Overview: Certificate Authorities (CAs) 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 TLS and Cryptography Libraries Used by MariaDB for more information about which libraries are used on which platforms. This option implies the --ssl option.
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.
List of permitted ciphers or cipher suites to use for TLS. This option implies the --ssl option.
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 Secure Connections Overview: Certificate Revocation Lists (CRLs) 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 TLS and Cryptography Libraries Used by MariaDB for more information about which libraries are used on which platforms.
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 openssl rehash command. See Secure Connections Overview: Certificate Revocation Lists (CRLs) 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 TLS and Cryptography Libraries Used by MariaDB for more information about which libraries are used on which platforms.
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.
Enables server certificate verification. This option is disabled by default.
Directory for temporary files.
Only upgrade the system tables in the mysql database. Tables in other databases are not checked or touched.
User for login if not current user.
Display more output about the process, using it twice will print connection arguments; using it 3 times will print out all CHECK, RENAME and ALTER TABLE commands used during the check phase; using it 4 times will also write out all mariadb-check commands used.
Output version information and exit.
Run this program only if its 'server version' matches the version of the server to which it's connecting check. Note: the 'server version' of the program is the version of the MariaDB server with which it was built/distributed. (Defaults to on; use --skip-version-check to disable.)
All commands, including those run by mariadb-check, are written to the binary log. Disabled by default.
All commands, including those run by mariadb-check, are written to the binary log. Enabled by default. The --skip-write-binlog option must be used when commands should not be sent to replication replicas.
In addition to reading options from the command line, mariadb-upgrade can also read options from option files. If an unknown option is provided to mariadb-upgrade 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:
--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.
mariadb-upgrade is linked with . However, MariaDB Connector/C does not handle the parsing of option files for mariadb-upgrade. That is still performed by the server option file parsing code. See MDEV-19035 for more information.
mariadb-upgrade reads options from the following option groups from option files:
[mysql_upgrade]
Options read by mariadb-upgrade, which includes both MariaDB Server and MySQL Server.
[mariadb-upgrade]
Options read by mariadb-upgrade. Available starting with .
[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 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.
MariaDB converts long table names properly.
MariaDB converts InnoDB tables (no need to do a dump/restore or ALTER TABLE).
MariaDB converts old archive tables to the new 5.1 format.
mysql_upgrade --verbose runs mariadb-check --verbose, so that you get more information of what is happening. Running with 3 times --verbose prints out all CHECK, RENAME and ALTER TABLE statements executed.
The is upgraded live. There is no need to restart the server to use events if the event table has changed.
More descriptive output.
If you are sure that all your tables are up to date with the current version, then you can run mariadb-upgrade ---upgrade-system-tables, which will only fix your system tables in the mysql database to be compatible with the latest version.
The main reason to run mariadb-upgrade on all your tables is to allow it to check that:
There has not been any change in table formats between versions.
This has not happened since MariaDB 5.1.
If some of the tables are using an index for which we have changed sort order.
This has not happened since MariaDB 5.5.
If you are sure this applies to your situation, you can just run mariadb-upgrade with the ---upgrade-system-tables option.
mariadb-upgrade recreates any missing tables in the mysql database. It doesn't touch any data in existing tables.
Previously, the tool first ran the upgrade process and then created the datadir/mysql_upgrade_info file. If the file could not be created because of permissions (mariadb-upgrade did not have rights to create the file), mariadb-upgrad gave an error, but this was often ignored. One effect of not being able to create the mysql_upgrade_info file was that every new mariadb-upgrade run would have to do a full upgrade check, which can take a while if there are a lot of tables.
mariadb-upgrade 2.0 fixes the following issues:
The datadir/mysql_upgrade_info is now created at the start of the upgrade process and locked. This ensures that two mariadb-upgrade processes cannot be run in parallel, which can cause deadlocks (MDEV-27068). One side effect of this is that mariadb-upgrade has to have write access to datadir, which means it has to be run as the user that installed MariaDB, normally 'mysql' or 'root' .
One can use mariadb-upgrade --force --force to force the upgrade to be run, even if there was no version change or if one doesn't have write access to datadir. Note that if this option is used, the next mariadb-upgrade run will assume that there is a major version change and the upgrade must be done (again).
The upgrade is done only if there is a major server version change (for instance, from MariaDB 10.5 to 10.6). This avoids unnecessary upgrades.
New option added: --check-if-upgrade-is-needed. If this is used, mariadb-upgrade will return 0 if there has been a major version change and you should run mariadb-upgrade. If not upgrade is needed, 1 is returned.
--verbose writes more information, including from which version to which version the upgrade is done.
Better messages when there is no need to run mariadb-upgrade.
This page is licensed: CC BY-SA / Gnu FDL
Maximum number of seconds to run all queries;
Number of clients running queries;
Average number of queries per client.
The command to use mariadb-slap and the general syntax is:
Options
mariadb-slap supports the following options:
-a, --auto-generate-sql
Generate SQL statements automatically when they are not supplied in files or via command options.
--auto-generate-sql-add-autoincrement
Add an AUTO_INCREMENT column to auto-generated tables.
--auto-generate-sql-execute-number=num
Specify how many queries to generate automatically.
--auto-generate-sql-guid-primary
Add GUID based primary keys to auto-generated tables.
--auto-generate-sql-load-type=name
Specify the test load type. The allowable values are read (scan tables), write (insert into tables), key (read primary keys), update (update primary keys), or mixed (half inserts, half scanning selects). The default is mixed.
--auto-generate-sql-secondary-indexes=num
Number of secondary indexes to add to auto-generated tables. By default, none are added.
Option Files
In addition to reading options from the command line, mariadb-slap can also read options from option files. If an unknown option is provided to mariadb-slap 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:
--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.
mariadb-slap is linked with MariaDB Connector/C. 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 MDEV-19035 for more information.
Option Groups
mariadb-slap reads options from the following option groups from option files:
[mysqlslap]
Options read by mariadb-slap, which includes both MariaDB Server and MySQL Server.
[mariadb-slap]
Options read by mariadb-slap. Available starting with .
[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.
Create a table with data, and then query it with 40 simultaneous connections 100 times each.
Using files to store the create and query SQL. Each file can contain multiple statements separated by the specified delimiter.
CC BY-SA / Gnu FDL
mariadb-binlog is a utility included with MariaDB for processing binary log and relay log files.
The following options are supported by . They can be specified on the command line or in option files.
Display a help statement.
--base64-output=name
Determine when the output statements should be base64-encoded BINLOG statements. Options (case-insensitive) include auto, unspec, never ,and decode-rows. never neither prints base64 encodings nor verbose event data, and exits on error if a is found. This option is useful for binlogs that are entirely statement-based. decode-rows decodes row events into commented SQL statements if the --verbose option is also given. It can enhance the debugging experience with large binary log files, as the raw data is omitted. Unlike never, mariadb-binlog does not exit with an error if a row event is found. auto
Default value: auto.
The maximum size in bytes of a row-based event. Should be a multiple of 256. Minimum 256, maximum 18446744073709547520. Default value: 4294967040 (4GB)
Directory where the are.
Output entries from the binary log (local log only) that occur while the name has been selected as the default database by . Only one database can be specified. The effects depend on whether the is in use. For statement-based logging, the server only logs statements where the default database is name. The default database is set with the statement. For row-based logging, the server logs any updates to any tables in the named database, irrespective of the current database. Ignored in --raw mode.
In a debug build, write a debugging log. A typical debug options string is d:t:o,file\_name. Default value: d:t:o,/tmp/mariadb-binlog.trace
Print some debug info at exit. Default value: FALSE
Print some debug info and memory and CPU info at exit. Default value: FALSE
Default authentication client-side plugin to use.
Read the file name, which can be the full path or the path relative to the current directory, after the global files are read.
Only read default options from the given file name, which can be the full path or the path relative to the current directory.
Also read groups with a suffix of str. For example, since mariadb-binlog normally reads the [client] and [mysqlbinlog] groups, --defaults-group-suffix=x would cause it to also read the groups \[mysqlbinlog\_x] and \[client\_x].
Disable binary log. This is useful if you enabled --to-last-log and are sending the output to the same MariaDB server. This way, you could avoid an endless loop. You would also like to use it when restoring after a crash to avoid duplication of the statements you already have. The SUPER privilege is needed to use this option. Default value: FALSE
A list of positive integers, separated by commas, that form a whitelist of domain ids. Any log event with a that originates from a domain id specified in this list is displayed. Cannot be used with --ignore-domain-ids. When used with --ignore-server-ids or --do-server-ids, the result is the intersection between the two datasets. Available from MariaDB 10.9.
A list of positive integers, separated by commas, that form a whitelist of server ids. Any log event originating from a server id specified in this list is displayed. Cannot be used with --ignore-server-ids. When used with --ignore-domain-ids or do-domain-ids, the result is the intersection between the two datasets. Alias for --server-id. Available from MariaDB 10.9.
Support mode. Default value: FALSE
Force if binlog was not closed properly. Defaults to ON; use --skip-force-if-open to disable. Default value: TRUE
If mariadb-binlog reads a binary log event that it does not recognize, it prints a warning, ignores the event, and continues. Without this option, mariadb-binlog stops if it reads such an event. Default value: FALSE
Process binlog according to gtid-strict-mode specification. The start, stop positions are verified to satisfy the start < stop comparison condition. Sequence numbers of any domain must comprise a monotonically growing sequence. Defaults to ON; use --skip-gtid-strict-mode to disable. Available from MariaDB 10.8. Default value: TRUE
Augment output with hexadecimal and ASCII event dump. Default value: FALSE
Get the binlog from the MariaDB server on the given host.
A list of positive integers, separated by commas, that form a blacklist of domain ids. Any log event with a that originates from a domain id specified in this list is hidden. Cannot be used with --do-domain-ids. When used with --ignore-server-ids or --do-server-ids, the result is the intersection between the two datasets. Available from MariaDB 10.9.
A list of positive integers, separated by commas, that form a blacklist of server ids. Any log event originating from a server id specified in this list is hidden. Cannot be used with --do-server-ids. When used with --ignore-domain-ids or --do-domain-ids, the result is the intersection between the two datasets. Available from MariaDB 10.9.
Prepare local temporary files for in the specified directory. The temporary files are not automatically removed.
Don't read default options from any option file.
Skip the first value entries in the log. Default value: 0
Reserve file descriptors for usage by mariadb-binlog. Default value: 64
Password to connect to the remote server. The password can be omitted, allow it to be entered from the prompt, or an option file can be used to avoid the security risk of passing a password on the command line.
Directory for client-side plugins.
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). Default value: 0
Removed. Use --start-position instead.
Print the program argument list from all option files and exit.
Print row counts for each row of events. (Defaults to ON; use --skip-print-row-count to disable.) Default value: TRUE
Print row event positions. Defaults to on; use --skip-print-row-event-positions to disable.) Default value: TRUE
Print metadata stored in Table_map_log_event.
The protocol of the connection (tcp, socket, pipe, memory).
Requires -R. Output raw binlog data instead of SQL statements. Output files are named after server logs.
Read binary logs from a remote MariaDB server rather than reading a local log file. Any connection parameter options are ignored unless this option is given as well. These options are --host, --password, --port, --protocol, --socket, and --user. This option requires that the remote server be running. It works only for binary log files on the remote server, not relay log files. Default value: FALSE
Direct output to a given file. With --raw, this is a prefix for the file names.
Updates to a database with a different name than the original. Example: rewrite-db='from->to'. For events that are logged as statements, rewriting the database constitutes changing a statement's default database from db1 to db2. There is no statement analysis or rewrite of any kind; that is, if you specify db1.tbl in the statement explicitly, that occurrence won't be changed to db2.tbl. Row-based events are rewritten correctly to use the new database name. Filtering (for instance, with --database=name) happens before the database rewrites have been performed. If you use this option on the command line and > has a special meaning to your command interpreter, quote the value (for instance, --rewrite-db="oldname->newname").
Extract only binlog entries created by the server having the given id. From MariaDB 10.9, an alias for --do-server-ids. Default value: 0
Add SET NAMES character_set to the output to specify the to be used for processing log files.
Shared-memory name to use for Windows connections using shared memory to a local server (started with the --shared-memory option). Case-sensitive. Default value: MYSQL
Just show regular queries: no extra info and no row-based events. This is for testing only, and should not be used in production systems. If you want to suppress base64-output, consider using --base64-output=never instead. Default value: FALSE
Skip all events in the mariadb-binlog output (by default, mariadb-binlog prints Annotate_rows events if the binary log contains them).
For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
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, you must specify the --ssl-verify-server-cert option. Default value: FALSE
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.
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 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 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.
Defines a path to the X509 certificate file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
List of permitted ciphers or cipher suites to use for . This option implies the --ssl option.
Defines 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.
Defines 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.
Defines a path to a private key file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
Enables . This option is disabled by default. Default value: FALSE
If specified, start reading the binlog at the first event having a datetime equal to or later than the argument; the argument must be a date and time in the local time zone, in any format accepted by the MariaDB server for and types, for example: 2014-12-25 11:25:56 (you should probably use quotes for your shell to set it properly). This option is useful for point-in-time recovery.
Start reading the binlog at this position. Type can either be a positive integer or, from MariaDB 10.8, a list. When using a positive integer, the value only applies to the first binlog passed on the command line. In GTID mode, multiple GTIDs can be passed as a comma-separated list, where each must have a unique domain id. The list represents the GTID binlog state that the client (another "replica" server) is aware of. Therefore, each GTID is exclusive; only events after a given sequence number are printed to allow users to receive events after their current state. Default value: 4
Options --start-position and --stop-position currently compare Sequence Numbers only per Domain ID and ignore Server IDs. This is incorrect, as it is different from the Replication design for GTIDs, which compares per Domain–Server ID pair. MDEV-37231 tracks this bug.
If specified, stop reading the binlog at the first event having a datetime equal to or posterior to the argument; the argument must be a date and time in the local time zone, in any format accepted by the MariaDB server for DATETIME and TIMESTAMP types, for example: 2014-12-25 11:25:56 (you should probably use quotes for your shell to set it properly). Ignored in --raw mode.
Emit a warning if the specified time is not found within the specified binlogs.
Wait for more data from the server (and thus requires -R or --read-from-remote-server) instead of stopping at the end of the last log. Implies --to-last-log.
The replica used for --read-from-remote-server --stop-never.
If specified, stop reading the binlog at this position. Type can either be a positive integer or, from MariaDB 10.8, a list. When using a positive integer, the value only applies to the last binlog passed on the command line. In GTID mode, multiple GTIDs can be passed as a comma-separated list, where each must have a unique domain id. Each GTID is inclusive; only events up to the given sequence numbers are printed. Ignored in --raw mode.
Emit a warning if the specified position or GTID is not within the specified binlogs.
Emit a warning if the specified position is beyond the end of the last binlog.
Options --start-position and --stop-position currently compare Sequence Numbers only per Domain ID and ignore Server IDs. This is incorrect, as it is different from the Replication design for GTIDs, which compares per Domain–Server ID pair. MDEV-37231 tracks this bug.
List entries for just this table (affects only row events).
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. Default value: TLSv1.1,TLSv1.2,TLSv1.3
Requires -R or --read-from-remote-server. Does not stop at the end of the requested binlog but rather continues printing until the end of the last binlog of the MariaDB server. If you send the output to the same MariaDB server, that may lead to an endless loop. Default value: FALSE
Connect to the remote server as username.
Reconstruct SQL statements out of row events. -v -v adds comments on column data types.
Print version and exit.
Verify when reading a binlog file.
In addition to reading options from the command line, mariadb-binlog can also read options from . If an unknown option is provided to mariadb-binlog in an option file, it is ignored.
The following options relate to how MariaDB command line tools handle option files. They must be given as the first argument on the command line:
mariadb-binlog is linked with . However, MariaDB Connector/C does not handle the parsing of option files for this client. That is performed by the server's option file parsing code. See for more information.
mariadb-binlog reads options from the following from the :
This page is licensed: CC BY-SA / Gnu FDL
mariadb-import [OPTIONS] database textfile1 [textfile2 ...]This installation of MariaDB is already upgraded to 10.11.4-MariaDB.
There is no need to run mysql_upgrade again for 10.11.11-MariaDB.
You can use --force if you still want to run mysql_upgrade.mariadb-upgrade [--force] [--user=# --password=#
--host=hostname --port=# --socket=#
--protocol=tcp|socket|pipe|memory
--verbose] [OTHER_OPTIONS]# Find out path to datadir
echo "show variables like 'datadir'" | mysql
mariadb-check --no-defaults --check-upgrade --auto-repair --databases mysql
mysql_fix_privilege_tables
mariadb-check --no-defaults --all-databases --fix-db-names --fix-table-names
mariadb-check --no-defaults --check-upgrade --all-databases --auto-repairmariadb-upgrade --verbose --verbose other-optionsmariadb-slap [options]mariadb-slap
--delimiter=";"
--create="CREATE TABLE t (a int);INSERT INTO t VALUES (5)"
--query="SELECT * FROM t"
--concurrency=40
--iterations=100
Benchmark
Average number of seconds to run all queries: 0.010 seconds
Minimum number of seconds to run all queries: 0.009 seconds
Maximum number of seconds to run all queries: 0.020 seconds
Number of clients running queries: 40
Average number of queries per client: 1mariadb-slap
--create=define.sql
--query=query.sql
--concurrency=10
--iterations=20
--delimiter=";"
Benchmark
Average number of seconds to run all queries: 0.002 seconds
Minimum number of seconds to run all queries: 0.002 seconds
Maximum number of seconds to run all queries: 0.004 seconds
Number of clients running queries: 10
Average number of queries per client: 1--auto-generate-sql-unique-query-number=num
Number of unique queries to generate for automatic tests. For example, if you run a key test that performs 1000 selects, you can use this option with a value of 1000 to run 1000 unique queries, or with a value of 50 to perform 50 different selects. The default is 10.
--auto-generate-sql-unique-write-number=num
Number of unique queries to generate for auto-generate-sql-write-number.
--auto-generate-sql-write-number=num
Number of row inserts to perform for each thread. The default is 100.
--commit=num
Number of statements to execute before committing. The default is 0.
-C, --compress
Use compression in server/client protocol if both support it.
-c name, --concurrency=name
Number of clients to simulate for query to run.
--create=name
File or string containing the statement to use for creating the table.
--create-schema=name
Schema to run tests in.
--csv[=name]
Generate comma-delimited output to named file or to standard output if no file is named.
-d, --debug[=options]
For debug builds, write a debugging log. A typical debug_options string is d:t:o,file_name. The default is d:t:o,/tmp/mariadb-slap.trace.
--debug-check
Check memory and open file usage at exit.
-T, --debug-info
Print some debug info at exit.
--default-auth=name
Default authentication client-side plugin to use.
--defaults-extra-file=name
Read this file 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.
-F name, --delimiter=name
Delimiter to use in SQL statements supplied in file or command line.
--detach=num
Detach (close and reopen) connections after the specified number of requests. The default is 0 (connections are not detached).
-e name, --engine=name
Comma separated list of storage engines to use for creating the table. The test is run for each engine. You can also specify an option for an engine after a #:#, for example memory:max_row=2300.
-?, --help
Display help and exit.
-h name, --host=name
Connect to the MariaDB server on the given host.
--init-command=name
SQL Command to execute when connecting to the MariaDB server. Will automatically be re-executed when reconnecting.
-i num, --iterations=num
Number of times to run the tests.
--no-defaults
Don't read default options from any option file. Must be given as the first option.
--no-drop
Do not drop any schema created during the test after the test is complete.
-x name, --number-char-cols=name
Number of VARCHAR columns to create in table if specifying --auto-generate-sql.
-y name, --number-int-cols=name
Number of INT columns to create in table if specifying --auto-generate-sql.
--number-of-queries=num
Limit each client to approximately this number of queries. Query counting takes into account the statement delimiter. For example, if you invoke as follows, mariadb-slap --delimiter=";" --number-of-queries=10 --query="use test;insert into t values(null)", the #; delimiter is recognized so that each instance of the query string counts as two queries. As a result, 5 rows (not 10) are inserted.
--only-print
Do not connect to the databases, but instead print out what would have been done.
-p[password], --password[=password]
Password to use when connecting to server. If password is not given it's asked from 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.
--post-query=name
Query to run or file containing query to execute after tests have completed. This execution is not counted for timing purposes.
--post-system=name
system() string to execute after tests have completed. This execution is not counted for timing purposes.
--pre-query=name
Query to run or file containing query to execute before running tests. This execution is not counted for timing purposes.
--pre-system=name
system() string to execute before running tests. This execution is not counted for timing purposes.
--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).
-q name, --query=name
Query to run or file containing query to run.
--shared-memory-base-name
Shared-memory name to use for Windows connections using shared memory to a local server (started with the --shared-memory option). Case-sensitive.
-s, --silent
Run program in silent mode - no output.
-S, --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. TLS is also enabled even without setting this option when certain other TLS options are set. The --ssl option will not enable verifying the server certificate 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 TLS. This option requires that you use the absolute path, not a relative path. See Secure Connections Overview: Certificate Authorities (CAs) 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 openssl rehash command. See Secure Connections Overview: Certificate Authorities (CAs) 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 TLS and Cryptography Libraries Used by MariaDB 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 TLS. 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 Secure Connections Overview: Certificate Revocation Lists (CRLs) 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 TLS and Cryptography Libraries Used by MariaDB for more information about which libraries are used on which platforms.
--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 openssl rehash command. See Secure Connections Overview: Certificate Revocation Lists (CRLs) 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 TLS and Cryptography Libraries Used by MariaDB for more information about which libraries are used on which platforms.
--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-verify-server-cert
Enables server certificate verification. This option is disabled by default.
-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.
unspecROW-format events are processed for re-executing on the MariaDB server. This behavior is presumed, such that auto is the default value when no option specification is provided. The other option values are intended only for debugging or testing purposes because they may produce output that does not include all events in executable form.--base64-output[=name]
Determine when the output statements should be base64-encoded BINLOG statements. Options (case-insensitive) include auto, unspec, always (deprecated), never , and decode-rows. never disables it and works only for binlogs without row-based events; decode-rows decodes row events into commented SQL statements if the --verbose option is also given. Unlike never, mariadb-binlog does not exit with an error if a row event is found auto or unspec, the default, prints base64 only when necessary (for instance, for and format description events), and is the only safe behavior if you intend to use the output of mariadb-binlog to re-execute binary log file contents. The other option values are intended only for debugging or testing purposes, because they may produce output that does not include all events in executable form. always prints base64 whenever possible, and is for debugging only and should not be used in a production system. If this option is not given, the default is auto; if it is given with no argument, always is used.
--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.
[mysqlbinlog]
Options read by mariadb-binlog, which includes both MariaDB Server and MySQL Server.
[mariadb-binlog]
Options read by mariadb-binlog.
[client]
Options read by all MariaDB and MySQL client programs, which include 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 are common between the server and the clients.
[client-mariadb]
Options read by all MariaDB client programs.
mariadb-check is a maintenance tool that allows you to check, repair, analyze and optimize multiple tables from the command line.
It is essentially a command-line interface to the , , , and statements, and so, unlike and , requires the server to be running.
This tool does not work with partitioned tables.
OR
OR
mariadb-check can be used to CHECK (-c, -m, -C), REPAIR (-r), ANALYZE (-a), or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be used in combination.
Not all options are supported by all storage engines.
The -c, -r, -a, and -o options are exclusive to each other.
The --check option is used by default, if no other options were specified. You can change the default behavior by making a symbolic link to the binary, or copying it somewhere with another name, the alternatives are:
mariadb-check supports the following options:
In addition to reading options from the command line, mariadb-check can also read options from . If an unknown option is provided to mariadb-check in an option file, 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:
mariadb-check 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-check reads options from the following from :
To see the default values for the options and the arguments you get from configuration files, you can do:
When running mariadb-check with --auto-repair (as done by ), mariadb-check will first check all tables and then in a separate phase repair those that failed the check.
mariadb-check --all-databases will ignore the internal log tables and as these can't be checked, repaired or optimized.
Using one --verbose option will give you more information about what mariadb-check is doing.
Using two --verbose options will also give you connection information.
If you use three --verbose options you will also get, on stdout, all , , and commands that mariadb-check executes.
From MariaDB 12.0, mariadb-check supports .
This page is licensed: CC BY-SA / Gnu FDL
This page is for the mariadb-install-db script for Linux/Unix only.
For the Windows specific tool of similar name and purpose see .
The Windows version shares the common theme (creating system tables), yet has a lot of functionality specific to Windows systems, for example creating a Windows service. The Windows version does not share command line parameters with the Unix shell script.
-C, --check-only-changed
Check only tables that have changed since last check or haven't been closed properly.
-g, --check-upgrade
Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates. Automatically enables the --fix-db-names and --fix-table-names options. Used .
--compress
Compress all information sent between the client and server if both support compression.
-B, --databases
Check several databases. Note that normally mariadb-check treats the first argument as a database name, and following arguments as table names. With this option, no tables are given, and all name arguments are regarded as database names.
## , --debug[=name]
Output debug log. Often this is d:t:o,filename.
--debug-check
Check memory and open file usage at exit.
--debug-info
Print some debug info at exit.
--default-auth=plugin
Default authentication client-side plugin to use.
--default-character-set=name
Set the default .
-e, --extended
Used with --check, it ensures that the table is fully consistent, but this takes a long time. Used with --repair, it forces the usage of the old, slow, repair mechanism with keycache method, instead of the much faster repair by sorting.
-F, --fast
Check only tables that haven't been closed properly.
--fix-db-names
Convert database names to the format used since MySQL 5.1. Only database names that contain special characters are affected. Used from an old MySQL version.
--fix-table-names
Convert table names (including ) to the format used since MySQL 5.1. Only table names that contain special characters are affected. Used from an old MySQL version.
--flush
Flush each table after check. This is useful if you don't want to have the checked tables take up space in the caches after the check.
-f, --force
Continue even if we get an SQL error.
-?, --help
Display this help message and exit.
-h name, --host=name
Connect to the given host.
-m, --medium-check
Faster than extended-check, but only finds 99.99 percent of all errors. This should be good enough for most cases.
-o, --optimize
Optimize tables.
-p, --password[=name]
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 --password or -p option on the command line, mariadb-check prompts for one. 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.
-Z, --persistent
When using ANALYZE TABLE (--analyze), it uses the PERSISTENT FOR ALL option, which forces for this table to be updated.
-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
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).
--process-tables
Perform the requested operation (check, repair, analyze, optimize) on tables. Enabled by default. Use --skip-process-tables to disable.
--process-views[=val]
Perform the requested operation (only or ). Possible values are NO, YES (correct the checksum, if necessary, add the mariadb-version field), UPGRADE_FROM_MYSQL (same as YES and toggle the algorithm MERGE<->TEMPTABLE.
--protocol=name
The connection protocol (tcp, socket, pipe, memory) to use for connecting to the server. Useful when other connection parameters would cause a protocol to be used other than the one you want.
-q, --quick
If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it tries to repair only the index tree. This is the fastest repair method for a table.
-r, --repair
Can fix almost anything except unique keys that aren't unique.
--shared-memory-base-name
Shared-memory name to use for Windows connections using shared memory to a local server (started with the --shared-memory option). Case sensitive.
-s, --silent
Print only error messages.
--skip-database
Don't process the database (case sensitive) specified as argument.
-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, you 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 . 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 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
Defines a path to the X509 certificate file to use for . 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-crl=name
Defines 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
Defines 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
Defines a path to a private key file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
--ssl-verify-server-cert
Enables . This option is disabled by default.
--tables
Overrides the --databases or -B option such that all name arguments following the option are regarded as table names.
--use-frm
For repair operations on MyISAM tables, get table structure from .frm file, so the table can be repaired even if the .MYI header is corrupted.
-u, --user=name
User for login if not current user.
-v, --verbose
Print info about the various stages. You can give this option several times to get even more information. See , below.
-V, --version
Output version information and exit.
--write-binlog
Write ANALYZE, OPTIMIZE, and REPAIR TABLE statements to the . Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.
mysqlrepair
The default option is -r (--repair).
mysqlanalyze
The default option is -a (--analyze).
mysqloptimize
The default option is -o (--optimize).
-A, --all-databases
Check all the databases. This is the same as --databases with all databases selected.
-1, --all-in-1
Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.
-a, --analyze
Analyze given tables.
--auto-repair
If a checked table is corrupted, automatically fix it. Repairing is done after all tables have been checked.
--character-sets-dir=name
Directory where character set files are installed.
-c, --check
Check table for errors.
--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.
[mysqlcheck]
Options read by mysqlcheck, which includes both MariaDB Server and MySQL Server.
[mariadb-check]
Options read by mariadb-check.
[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.
mariadb-install-db initializes the MariaDB data directory and creates the system tables in the mysql database, if they do not exist.MariaDB uses these tables to manage privileges, roles, and plugins. It also uses them to provide the data for the help command in the mariadb client.
mariadb-install-db works by starting MariaDB Server's mariadbd process in --bootstrap mode and sending commands to create the system tables and their content.
Invoke mariadb-install-db using the following syntax:
Because the MariaDB server (mariadbd) needs to access the data directory when it runs, you should either run mariadb-install-db from the same account that is used for running mariadbd, or run it as root and use the --user option to indicate the username that mariadbd runs as. It might be necessary to specify other options such as --basedir or --datadir if mariadb-install-db does not use the correct locations for the installation directory or data directory. Here is a typical invocation:
mariadb-install-db supports the following options:
If set to normal, it creates a root@localhost account that authenticates with the mysql_native_password authentication plugin and that has no initial password set, which can be insecure. If set to socket, it creates a root@localhost account that authenticates with the unix_socket authentication plugin. Set to socket by default.
Used with --auth-root-authentication-method=socket. It specifies the name of the second account to create with SUPER privileges in addition to root, as well as of the system account allowed to access it. Defaults to the value of --user.
The path to the MariaDB installation directory.
If using --srcdir with out-of-directory builds, you will need to set this to the location of the build directory where built files reside.
Initialize MariaDB for catalogs. Argument is a list of the catalogs to create, separated with space or comma. The def catalog is created automatically. This option is available from MariaDB 11.7.
User when adding catalogs to running server. This option is available from MariaDB 11.7.
Password for catalog-user. This option is available from MariaDB 11.7.
Other arguments to mariadb when adding new catalogs. This option is available from MariaDB 11.7.
For internal use. Used when building the MariaDB system tables on a different host than the target.
The path to the MariaDB data directory.
Write commands to-be executed in /tmp/mariadb_install_db.log. This option is available from MariaDB 11.6.
Start mariadbd (server) with --debug.
Read this file after the global files are read. Must be given as the first option.
Only read default options from the given file name. Must be given as the first option.
In addition to the given groups, read also groups with this suffix.
Causes mariadb-install-db to run even if DNS does not work. In that case, grant table entries that normally use host names will use IP addresses.
Don't read default options from any option file. Must be given as the first option.
Print the program argument list and exit. Must be given as the first option.
For internal use. This option is used by RPM files during the MariaDB installation process.
Uses IP addresses rather than host names when creating grant table entries. This option can be useful if your DNS does not work.
Don't install the test database.
For internal use. The path to the MariaDB source directory. This option uses the compiled binaries and support files within the source tree, useful for if you don't want to install MariaDB yet and just want to create the system tables. The directory under which mariadb-install-db looks for support files such as the error message file and the file for populating the help tables.
The login username to use for running mariadbd. Files and directories created by mariadbd is owned by this user. You must be root to use this option. By default, mariadbd runs using your current login name and files and directories that it creates is owned by you.
Verbose mode. Print more information about what the program does.
For internal use. This option is used for creating Windows distributions.
In addition to reading options from the command line, mariadb-install-db can also read options from option files. If an unknown option is provided to mariadb-install-db 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:
--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.
mariadb-install-db reads options from the following option groups from option files:
[mysql_install_db]
Options read by mysqld_safe, which includes both MariaDB Server and MySQL Server.
mariadb-install-db also reads options from the following server option groups from option files:
[mysqld]
Options read by mysqld, which includes both MariaDB Server and MySQL Server.
[server]
Options read by MariaDB Server.
[mysqld-X.Y]
Options read by a specific version of mysqld, which includes both MariaDB Server and MySQL Server. For example, [mysqld-5.5].
[mariadb]
Options read by MariaDB Server.
[mariadb-X.Y]
Options read by a specific version of MariaDB Server.
[client-server]
Options read by all MariaDB and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients.
If you have just compiled MariaDB from source, and if you want to use mariadb-install-db from your source tree, then that can be done without having to actually install MariaDB. This is very useful if you want to test your changes to MariaDB without disturbing any existing installations of MariaDB.
To do so, you would have to provide the --srcdir option. For example:
If you install a binary tarball package in a non standard path, like your home directory, and if you already have a MariaDB / MySQL package installed, then you may get conflicts
with the default /etc/my.cnf. This often results in permissions
errors.
One possible solution is to use the --no-defaults option, so that it does not read any option files. For example:
Another possible solution is to use the defaults-file option, so that you can specify your own option file. For example:
mariadb-install-db sets --auth-root-authentication-method=socket by default. When this is set, the default root@localhost user account is created with the ability to use two authentication plugins:
First, it is configured to try to use the unix_socket authentication plugin. This allows the root@localhost user to login without a password via the local Unix socket file defined by the socket system variable, as long as the login is attempted from a process owned by the operating system root user account.
Second, if authentication fails with the unix_socket authentication plugin, then it is configured to try to use the mysql_native_password authentication plugin.
The definition of the default root@localhost user account is:
Since mariadb-install-db sets --auth-root-authentication-method=socket by default, the following additional user accounts are not created by default:
root@127.0.0.1
root@::1
root@${current_hostname}
However, an additional user account that is defined by the --auth-root-socket-user option is created. If this option is not set, then the value defaults to the value of the --user option. On most systems, the --user option will use the value of mysql by default, so this additional user account would be called mysql@localhost.
The definition of this mysql@localhost user account is similar to the root@localhost user account:
An invalid password is initially set for both of these user accounts. This means that before a password can be used to authenticate as either of these user accounts, the accounts must first be given a valid password by executing the SET PASSWORD statement.
For example, here is an example of setting the password for the root@localhost user account immediately after installation:
You may notice in the above example that the mariadb command-line client is executed via sudo. This allows the root@localhost user account to successfully authenticate via the unix_socket authentication plugin.
If mariadb-install-db fails, you should examine the error log in the data directory, which is the directory specified with --datadir option. This should provide a clue about what went wrong.
You can also test that this is not a general fault of MariaDB Server by trying to start the mariadbd process. The -skip-grant-tables option will tell it to ignore the system tables. Enabling the general query log can help you determine what queries are being run on the server. For example:
At this point, you can use the mariadb client to connect to the mysql database and look at the system tables. For example:
The following only apply in the exceptional case that you are using a mariadbd server which is configured with the --disable-grant-options option:
mariadb-install-db needs to invoke mariadbd with the--bootstrap and --skip-grant-tables options.
A MariaDB configured with the --disable-grant-options
option has --bootstrap and --skip-grant-tables
disabled. To handle this case, set the MYSQLD_BOOTSTRAP environment
variable to the full path name of a mariadbd server that is configured without --disable-grant-options. mariadb-install-db will use that server.
When calling the mariadb-install-db script, a new folder called test is created in the data directory.
It only has the single db.opt file, which sets the client options default-character-set and default-collation only.
If you run mysql as an anonymous user, mysql -u''@localhost, and look for the grants and databases you are able to work with, you will get the following:
Shown are the information_schema as well as test databases that are built in databases.
But looking from SHOW GRANTS appears to be a paradox; how can the current user see something if they don't have privileges for that?
Let's go a step further.
Now, use the root/unix user, which has all rights, in order to create a new database with the prefix test_ , something like:
With the above change, a new directory is created in the data directory. Now login again with the anonymous user and run SHOW DATABASES:
Again we are able to see the newly created database, without any rights?
We have an anonymous user that has no privileges, but still can see the test and test_electricity databases. Where does this come from?
Log in with the root/unix user to find out all privileges that the anonymous user has:
As seen above from the mysql.user table, the anonymous user doesn't have any global privileges.
Still, the anonymous user can see databases, so there must be a way so that anonymous user can see the test and test_electricity databases.
Let's check for grants on the database level. That information can be found in the mysql.db table.
Looking at the mysql.db table, it already contains 2 rows created when the mariadb-install-db script was invoked.
The anonymous user has database privileges (without grant, alter_routine and execute) on test and test_% databases:
The first row is reserved for explicit usage for the test database, which is automatically created with mariadb-install-db.
Since database test_electricity satisfies the test_% pattern where test_ is a prefix, we can understand why the user has the right to work with the newly-created database.
As long as records in mysql.db for the anonymous user exists, each new user created will have the privileges for the test and test_% databases.
Other databases privileges are not automatically granted for the newly created user. We have to grant privileges, which is visible in mysql.db table.
If you run mariadb-install-db with the --skip-test-db option, no test database is created, which we can see as follows:
Also, no anonymous user is created (only unix/mariadb.sys/root users):
The Windows version of mariadb-install-db: mysql_install_db.exe
This page is licensed: CC BY-SA / Gnu FDL
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.
The command to use mariadb-admin and the general syntax is:
mariadb-admin supports the following options:
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:
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.
mariadb-admin reads options from the following .
Variables can be set with --variable-name=value.
Command is one or more of the following. Commands can be shortened to a unique prefix.
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.
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:
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.
, 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
./client/mariadb-check [OPTIONS] database [tables]./client/mariadb-check [OPTIONS] --databases DB1 [DB2 DB3...]./client/mariadb-check [OPTIONS] --all-databases./client/mariadb-check --print-defaults
./client/mariadb-check --help$ mariadb-install-db [options]$ scripts/mariadb-install-db --user=mysql \
--basedir=/opt/mysql/mysql \
--datadir=/opt/mysql/mysql/data./scripts/mariadb-install-db --srcdir=. --datadir=path-to-temporary-data-dir./scripts/mariadb-install-db --no-defaults --basedir=. --datadir=data./scripts/mariadb-install-db --defaults-file=~/.my.cnfCREATE USER 'root'@'localhost' IDENTIFIED VIA unix_socket
OR mysql_native_password USING 'invalid';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION;CREATE USER 'mysql'@'localhost' IDENTIFIED VIA unix_socket
OR mysql_native_password USING 'invalid';
GRANT ALL PRIVILEGES ON *.* TO 'mysql'@'localhost' WITH GRANT OPTION;$ sudo yum install MariaDB-server
$ sudo systemctl start mariadb
$ sudo mariadb
...
MariaDB> SET PASSWORD = PASSWORD('XH4VmT3_jt');mariadbd --skip-grant-tables --general-log$ /usr/local/mysql/bin/mysql -u root mysql
MariaDB [mysql]> show tablesSELECT current_user;
+--------------+
| current_user |
+--------------+
| @localhost |
+--------------+
SHOW GRANTS FOR current_user;
+--------------------------------------+
| Grants for @localhost |
+--------------------------------------+
| GRANT USAGE ON *.* TO ``@`localhost` |
+--------------------------------------+
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+CREATE DATABASE test_electricity;SHOW DATABASES
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
| test_electricity |
+--------------------+SELECT * FROM mysql.user WHERE user='' AND host='localhost'\G
*************************** 1. row ***************************
Host: localhost
User:
Password:
Select_priv: N
Insert_priv: N
Update_priv: N
Delete_priv: N
Create_priv: N
Drop_priv: N
Reload_priv: N
Shutdown_priv: N
Process_priv: N
File_priv: N
Grant_priv: N
References_priv: N
Index_priv: N
Alter_priv: N
Show_db_priv: N
Super_priv: N
Create_tmp_table_priv: N
Lock_tables_priv: N
Execute_priv: N
Repl_slave_priv: N
Repl_client_priv: N
Create_view_priv: N
Show_view_priv: N
Create_routine_priv: N
Alter_routine_priv: N
Create_user_priv: N
Event_priv: N
Trigger_priv: N
Create_tablespace_priv: N
Delete_history_priv: N
ssl_type:
ssl_cipher:
x509_issuer:
x509_subject:
max_questions: 0
max_updates: 0
max_connections: 0
max_user_connections: 0
plugin:
authentication_string:
password_expired: N
is_role: N
default_role:
max_statement_time: 0.000000SELECT * FROM mysql.db\G
*************************** 1. row ***************************
Host: %
Db: test
User:
Select_priv: Y
Insert_priv: Y
Update_priv: Y
Delete_priv: Y
Create_priv: Y
Drop_priv: Y
Grant_priv: N
References_priv: Y
Index_priv: Y
Alter_priv: Y
Create_tmp_table_priv: Y
Lock_tables_priv: Y
Create_view_priv: Y
Show_view_priv: Y
Create_routine_priv: Y
Alter_routine_priv: N
Execute_priv: N
Event_priv: Y
Trigger_priv: Y
Delete_history_priv: Y
*************************** 2. row ***************************
Host: %
Db: test\_%
User:
Select_priv: Y
Insert_priv: Y
Update_priv: Y
Delete_priv: Y
Create_priv: Y
Drop_priv: Y
Grant_priv: N
References_priv: Y
Index_priv: Y
Alter_priv: Y
Create_tmp_table_priv: Y
Lock_tables_priv: Y
Create_view_priv: Y
Show_view_priv: Y
Create_routine_priv: Y
Alter_routine_priv: N
Execute_priv: N
Event_priv: Y
Trigger_priv: Y
Delete_history_priv: YSHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
SELECT * FROM mysql.db;
Empty set (0.001 sec)SELECT user,host FROM mysql.user;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| anel | localhost |
| mariadb.sys | localhost |
| root | localhost |
+-------------+-----------+[galera]
Options read by a galera-capable MariaDB Server. Available on systems compiled with Galera support.
--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.
aliasmain.alias 'main' is the name of the suite for the 't' directory.--embedded-server
Use the embedded server, i.e., no mysqld daemons.
--ps-protocol
Use the binary protocol between client and server.
--cursor-protocol
Use the cursor protocol between client and server (implies --ps-protocol).
--view-protocol
Create a view to execute all non- updating queries.
--sp-protocol
Create a stored procedure to execute all queries.
--compress
Use the compressed protocol between client and server if both support it.
--tmpdir=DIR
The directory where temporary files are stored (default: ./var/tmp). The environment variable MYSQL_TMP_DIR is set to the path for this directory, whether it has the default value or has been set explicitly. This may be referred to in tests.
--vardir=DIR
The directory where files generated from the test run is stored (default: ./var). Specifying a ramdisk or tmpfs will speed up tests. The environment variable MYSQLTEST_VARDIR is set to the path for this directory, whether it has the default value or has been set explicitly. This may be referred to in tests.
--mem
Run testsuite in "memory" using tmpfs or ramdisk. This can decrease test times significantly, in particular if you would otherwise be running over a remote file system. Attempts to find a suitable location using a built-in list of standard locations for tmpfs (/dev/shm). The option can also be set using the environment variable MTR_MEM=[DIR]. If DIR is given, it is added to the beginning of the list of locations to search, so it takes precedence over any built-in locations. Once you have run tests with --mem within a mariadb-testdirectory, a soflink var will have been set up to the temporary directory, and this is reused the next time, until the soflink is deleted. Thus, you do not have to repeat the --mem option next time.
--client-bindir=PATH
Path to the directory where client binaries are located.
--client-libdir=PATH
Path to the directory where client libraries are located.
--force
Normally, mariadb-test-run.pl exits if a test case fails. --force causes execution to continue regardless of test case failure.
--with-ndbcluster-only
Run only tests that include "ndb" in the filename.
--skip-ndb[cluster]
Skip all tests that need a cluster. Default.
--do-test=PREFIX or REGEX
Run test cases with names prefixed with PREFIX or that fulfil the REGEX. For example, --do-test=testa matches tests that begin with testa, --do-test=main.testa matches tests in the main test suite that begin with testa, and --do-test=main.*testa matches test names that contain main followed by testa with anything in between. In the latter case, the pattern match is not anchored to the beginning of the test name, so it also matches names such as xmainytestz.
--skip-test=PREFIX or REGEX
Skip test cases with names prefixed with PREFIX or that fulfil the REGEX. See -do-test for examples.
--start-from=PREFIX
Sorts the list of names of the test cases to be run, and then starts with the test prefixed with PREFIX, where the prefix may be suite.testname or just testname.
--[mtr-]port-base=num
Base for port numbers. Ports from this number to number+9 are reserved. Should be divisible by 10; if not it is rounded down. May be set with the environment variable MTR_PORT_BASE. If this value is set and is not "auto", it overrides build-thread.
--[mtr-]build-thread=num
Specify a unique number to calculate port number(s) from. Can be set in the environment variable MTR_BUILD_THREAD. Set MTR_BUILD_THREAD="auto" to automatically acquire a build thread id that is unique to the current host. The more logical --port-base is supported as an alternative.
--record TESTNAME
(Re)generate the result file for TESTNAME.
--check-testcases
Check testcases for side-effects. This is done by checking the system state before and after each test case; if there is any difference, a warning to that effect is written, but the test case will not be marked as failed because of it. This check is enabled by default. Use --nocheck-testcases to disable.
mark-progress
Log line number and elapsed time to <testname>.progress
--mysqld=ARGS
Specify additional arguments to "mysqld"
--mysqltest=ARGS
Specify additional arguments to "mariadb-test". Use additional --mysqld-env options to set more than one variable.
extern option=value
Use an already running server. The option/value pair is what is needed by the mariadb client to connect to the server. Each --extern option can only take one option/value pair as an argument, so you need to repeat --extern for each pair needed. Example: ./mariadb-test-run.pl --extern socket=var/tmp/mysqld.1.sock alias. Note: If a test case has an .opt file that requires the server to be restarted with specific options, the file will not be used. The test case likely will fail as a result.
In mariadb-test-run.pl, there is a concept of a "debugger". A "debugger" is a tool that mariadb-test-run.pl will execute instead of mariadbd. This tool will then start mariadbd and can control its execution as it wants. The following "debuggers" are supported:
gdb
ddd
dbx
devenv
windbg
lldb
Every "debugger" from the list above supports the following set of options (replace XXX below with a debugger name)
--XXX
Start mariadbd process under a debugger
--client-XXX
Start mariadb-test process under a debugger
--boot-XXX
Before running tests, mariadb-test-run executes mariadbd to bootstrap, prepare the datadir. This option causes this bootstrapping mariadbd process to be run under a debugger.
--manual-XXX
Don't start anything; instead, print the command that the user needs to run to start mariadbd under a debugger. Then wait.
Every option from the above accepts an optional argument. It can be used to specify additional command-line options to pass to the tool. Or additional commands that the tool will run on startup. Or both. Commands are separated from each other and from options with a semicolon. For example:
--debug
Dump trace output for all servers and client programs.
--debug-common
Same as --debug, but sets the 'd' debug flags to "query,info,error,enter,exit"
--debug-server
Use the debug version of the server, but without turning on tracing.
--max-save-core
Limit the number of core files saved (to avoid filling up disks for a heavily crashing server). Defaults to 5, set to 0 for no limit. Set its default with MTR_MAX_SAVE_CORE.
--max-save-datadir
Limit the number of datadir saved (to avoid filling up disks for a heavily crashing server). Defaults to 20, set to 0 for no limit. Set its default with MTR_MAX_SAVE_DATDIR.
--max-test-fail
Limit the number of test failures before aborting the current test run. Defaults to 10, set to 0 for no limit. Set its default with MTR_MAX_TEST_FAIL.
--user=USER
User for connecting to mysqld (default: root)
--comment=STR
Write STR to the output within lines filled with #, as a form of banner.
--timer
Show test case execution time. Use no-timer to disable.
--verbose
More verbose output (use multiple times for even more)
--verbose-restart
Write when and why servers are restarted between test cases.
--start
Only initialize and start the servers, using the startup settings for the first specified test case. Example: ./mariadb-test-run.pl --start alias & start-dirty. Only start the servers (without initialization) for the first specified test case
This page is licensed: GPLv2
mariadb-admin [options] command [command-arg] [command [command-arg]] ...mariadb-admin [options] command [command-arg] [command [command-arg]] ...mariadb-admin --wait-for-all-slaves shutdownshell> 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.004mariadb-admin: shutdown failed; error: 'Access denied; you need (at least one of) the SHUTDOWN privilege(s) for this operation'kill -SIGTERM pid-of-mariadbd-processNET STOP MySQL./mariadb-test-run.pl [ OPTIONS ] [ TESTCASE ]path-to-testcase
[suite.]testcase[,combination]rpl.rpl_invoked_features,mix,xtradb_plugin
suite/rpl/t/rpl.rpl_invoked_features./mtr 1st --strace
./mtr 1st --client-rr=--chaos
./mtr 1st --manual-gdb='b mysql_parse;r'
./mtr 1st --boot-gdb='--quiet --tui;b mysql_parse;r'--ssl
If mariadb-test-run.pl is started with the --ssl option, it sets up a secure connection for all test cases. In this case, if mysqld does not support TLS, mariadb-test-run.pl exits with an error message: Couldn´t find support for SSL.
--skip-ssl
Don't start the server with support for TLS connections.
--vs-config
Visual Studio configuration used to create executables (default: MTR_VS_CONFIG environment variable).
--parallel=num
How many parallel tests should be run. Default is 1, use --parallel=auto for auto-setting of num.
--defaults-file=
Use a fixed config template for all tests.
--defaults_extra_file=
Extra config template to add to all generated configs.
--combination=
Extra options to pass to mysqld. The value should consist of one or more comma-separated mysqld options. This option is similar to --mysqld but should be given two or more times. mariadb-test-run.pl executes multiple test runs, using the options for each instance of --combination in successive runs. If --combination is given only once, it has no effect. For test runs specific to a given test suite, an alternative to the use of --combination is to create a combinations file in the suite directory. The file should contain a section of options for each test run.
--dry-run
Don't run any tests; print the list of tests that were selected for execution.
--suite[s]=NAME1,..,NAMEN
Comma separated list of suite names to run. The default, as of , is:"main-, archive-, binlog-, binlog_encryption-, csv-, compat/oracle-, encryption-, federated-, funcs_1-, funcs_2-, gcol-, handler-, heap-, innodb-, innodb_fts-, innodb_gis-, innodb_zip-, json-, maria-, mariadb-backup-, multi_source-, optimizer_unfixed_bugs-, parts-, perfschema-, plugins-, roles-, rpl-, sys_vars-, sql_sequence-, unit-, vcol-, versioning-,period-".
--skip-rpl
Skip the replication test cases.
--big-test
Allow tests marked as "big" to run. Tests can be thus marked by including the line --source include/big_test.inc, and they will only be run if this option is given, or if the environment variable BIG_TEST is set to 1. Repeat this option twice to run only "big" tests. This is typically used for tests that take a very long time to run, or that use many resources, so that they are not suitable for running as part of a normal test suite run.
--staging-run
Run a limited number of tests (no slow tests). Used for running staging trees with valgrind.
--enable-disabled
Ignore any disabled.def file, and also run tests marked as disabled. Success or failure of those tests is reported the same way as other tests.
--print-testcases
Don't run the tests, but print details about all the selected tests, in the order they would be run.
--skip-test-list=FILE
Skip the tests listed in FILE. Each line in the file is an entry and should be formatted as: <TESTNAME>:<COMMENT>.
valgrind
strace
rr
--start-and-exit
Same as --start, but mariadb-test-run terminates and leaves just the server running.
--start-dirty
This is similar to --start, but will skip the database initialization phase and assume that database files are already available. Usually, this means you must have run another test first.
--user-args
In combination with start* and no test name, drops arguments to mysqld except those specified with --mysqld (if any).
--wait-all
If --start or --start-dirty option is used, wait for all servers to exit before finishing the process. Otherwise, it will terminate if one (of several) servers is restarted.
--fast
Do not perform a controlled shutdown when servers need to be restarted or at the end of the test run. This is equivalent to using --shutdown-timeout=0.
--force-restart
Always restart servers between tests.
--parallel=N
Run tests in N parallel threads (default 1). Use parallel=auto for auto-setting of N.
--repeat=N
Run each test N number of times.
--retry=N
If a test fails, it is retried up to a maximum of N runs (default 1). Retries are also limited by the maximum number of failures before stopping, set with the --retry-failure option. This option has no effect unless --force is also used; without it, test execution will terminate after the first failure. The --retry and --retry-failure options do not affect how many times a test repeated with --repeat may fail in total, as each repetition is considered a new test case, which may in turn be retried if it fails.
--retry-failure=N
When using the --retry option to retry failed tests, stop when N failures have occurred (default 2). Setting it to 0 or 1 effectively turns off retries.
--reorder
Reorder tests to get fewer server restarts. This is the default behavior. There is no guarantee that a particular set of tests will always end up in the same order. Use -no-reorder to disable.
--help
Display help text.
--testcase-timeout=MINUTES
Max test case run time in minutes (default 15).
--suite-timeout=MINUTES
Max test suite run time in minutes (default 360).
--shutdown-timeout=SECONDS
Max number of seconds to wait for server shutdown before killing servers (default 10).
--warnings
Scan the log files for warnings and report any suspicious ones; if any are found, the test is marked as failed. Use --nowarnings to turn off.
--stop-file=file
If this file is detected, mariadb-test will not start new tests until the file is removed (also the MTR_STOP_FILE environment variable).
--stop-keep-alive=sec
Works with --stop-file, print messages every second when mariadb-test is waiting to remove the file (for buildbot) (also MTR_STOP_KEEP_ALIVE environment variable).
--sleep=SECONDS
Passed to mariadb-test; it is used as a fixed sleep time.
--debug-sync-timeout=NUM
Set default timeout for WAIT_FOR debug sync actions. Disable facility with NUM=0.
--gcov
Collect coverage information after the test. The result is a file per source and header file, and a last_changes.dgcov file in the vardir with the coverage for the uncommitted changes, if any (or the last commit).
--gprof
Collect profiling information using the gprof profiling tool.
--experimental=
Specify a file that contains a list of test cases that should be displayed with the [ exp-fail ] code rather than [ fail ] if they fail. For an example of a file that might be specified via this option, see mariadb-test/collections/default.experimental.
--report-features
First, run a "test" that reports MariaDB features, displaying the output of SHOW ENGINES and SHOW VARIABLES. This can be used to verify that binaries are built with all required features.
--timestamp
Print the timestamp before each test report line, showing when the test ended.
--timediff
Used with --timestamp, also print the time passed since the previous test started.
--max-connections=N
Maximum number of simultaneous server connections that may be used per test. Default is 128. Minimum is 8, maximum is 5120. Corresponds to the same option for mariadb-test.
--default-myisam
--report-times
Report how much time has been spent on different phases of test execution.
--stress=ARGS
Run stress test, providing options to mysql-stress-test.pl. Options are separated by a comma.
xml-report=
Output jUnit xml file of the results. From , , , ,
tail-lines=N
Number of lines of the result to include in a failure report. From .
mariadb is a simple SQL shell with GNU readline capabilities.
The command-line client is called mariadb. On Unix system, a symlink named mysql is available. On Windows, an alternative binary named mysql.exe is available.
The command-line client is called mysql.
mariadb supports interactive and non-interactive use. When used interactively, query results are presented in an ASCII-table format. When used non-interactively (for example, as a filter), the result is presented in tab-separated format. The output format can be changed using command options.
If you have problems due to insufficient memory for large result sets, use the--quick option. This forces mariadb to retrieve results from the server a row at a time rather than retrieving the entire result set and buffering it in memory before displaying it. This is done by returning the result set using the mysql_use_result() C API function in the client/server library rather than mysql_store_result().
Invoke the client from the prompt of your command interpreter (for instance, cmd on Windows, Terminal on macOS) as follows:
Alternatively, start the client and log on to MariaDB server:
Type an SQL statement, end it with a semicolon (;), \g, or \G , and press Enter.
Typing Control-C causes mariadb to attempt to kill the current statement. If this cannot be done, or Control-C is typed again before the statement is killed, mariadb exits.
You can execute SQL statements in a script file (batch file) like this:
The client's general syntax is:
mariadb supports the following options:
-?, --helpDisplay help and exit.
-I, --helpSynonym for -?
--abort-source-on-errorAbort 'source filename' operations in case of errors.
--auto-rehashEnable automatic rehashing. This option is on by default, which enables database, table, and column name completion. Use --disable-auto-rehash, --no-auto-rehash or skip-auto-rehash to disable rehashing. That causes mariadb to start faster, but you must issue the rehash command if you want to use name completion. To complete a name, enter the first part and press Tab. If the name is unambiguous, mariadb completes it. Otherwise, you can press Tab again to see the possible names that begin with what you have typed so far. Completion does not occur if there is no default database.
-A, --no-auto-rehashNo automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mariadb and disables rehashing on reconnect.
--auto-vertical-outputAutomatically switch to vertical output mode if the result is wider than the terminal width.
-B, --batchPrint results using tab as the column separator, with each row on a new line. With this option, mariadb does not use the history file. Batch mode results in nontabular output format and escaping of special characters. Escaping may be disabled by using raw mode; see the description for the --raw option. (Enables --silent.)
--binary-modeBy default, ASCII '\0' is disallowed and \r\n is translated to \n. This switch turns off both features, and also turns off parsing of all client commands except \C and DELIMITER, in non-interactive mode (for input piped to mariadb or loaded using the source command). This is necessary when processing output from that may contain blobs.
--character-sets-dir=nameDirectory for files.
--column-namesWrite column names in results. (Defaults to ON; use --skip-column-names to disable.)
--column-type-infoDisplay column type information.
-c, --commentsPreserve comments. Send comments to the server. The default is --skip-comments (discard comments), enable with --comments.
-C, --compressCompress all information sent between the client and the server if both support compression.
--connect-expired-passwordNotify the server that this client is prepared to handle even if --batch was specified.
--connect-timeout=numNumber of seconds before connection timeout. Defaults to 0.
-D, --database=nameDatabase to use.
-``[options], --debug[=options]On debugging builds, write a debugging log. A typical debug_options string is d:t:o,file_name. The default is d:t:o,/tmp/mysql.trace.
--debug-checkCheck memory and open file usage at exit.
-T, --debug-infoPrint some debug info at exit.
--default-auth=pluginDefault authentication client-side plugin to use.
--default-character-set=nameSet the default . A common issue that can occur when the operating system uses utf8 or another multibyte character set is that output from the mariadb client is formatted incorrectly, due to the fact that the MariaDB client uses the latin1 character set by default. You can usually fix such issues by using this option to force the client to use the system character set instead. If set to auto the character set is taken from the client environment (LC_CTYPE on Unix).
--defaults-extra-file=fileRead this file after the global files are read. Must be given as the first option.
--defaults-file=fileOnly read default options from the given file. Must be given as the first option.
--defaults-group-suffix=suffixIn addition to the given groups, also read groups with this suffix.
--delimiter=nameDelimiter to be used. The default is the semicolon (;).
--enable-cleartext-pluginObsolete option. Exists only for MySQL compatibility.
-e, --execute=nameExecute statement and quit. Disables --force and history file. The default output format is like that produced with --batch.
-f, --forceContinue even if we get an SQL error. Sets --abort-source-on-error to 0.
-h, --host=hostConnect to host.
-H, --htmlProduce HTML output.
-U, --i-am-a-dummySynonym for option --safe-updates, -U.
-i, --ignore-spacesIgnore space after function names. Allows one to have spaces (including tab characters and new line characters) between function name and '('. The drawback is that this causes built in functions to become reserved words.
--init-command=strSQL Command to execute when connecting to the MariaDB server. Will automatically be re-executed when reconnecting.
--line-numbersWrite line numbers for errors. (Defaults to ON; use --skip-line-numbers to disable.)
--local-infileEnable or disable LOCAL capability for . With no value, the option enables LOCAL. The option may be given as--local-infile=0 or --local-infile=1 to explicitly disable or enable LOCAL. Enabling LOCAL has no effect if the server does not also support it.
--max-allowed-packet=numThe maximum packet length to send to or receive from server. The default is 16MB, the maximum 1GB.
--max-join-size=numAutomatic limit for rows in a join when using --safe-updates. Default is 1000000.
-G, --named-commandsEnable named commands. Named commands mean mariadb's internal commands (see below) . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Long-format commands are allowed, not just short-format commands. For example, quit and \q are both recognized. Disable with --disable-named-commands. This option is disabled by default.
--net-buffer-length=numThe buffer size for TCP/IP and socket communication. Default is 16KB.
-b, --no-beepTurn off beep on error.
--no-defaultsDon't read default options from any option file. Must be given as the first option.
-o, --one-databaseIgnore statements except those that occur while the default database is the one named on the command line. This filtering is limited, and based only on statements. This is useful for skipping updates to other databases in the binary log.
--pager[=name]Pager to use to display results (Unix only). If you don't supply an option, the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.
-p, --password[=password]Password to use when connecting to 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 --password or -p option on the command line, mariadb prompts for one. 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.
--plugin-dir=nameDirectory for client-side plugins.
-P, --port=numPort 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-defaultsPrint the program argument list and exit. Must be given as the first option.
--progress-reportsGet for long running commands (such as ). (Defaults to ON; use --skip-progress-reports to disable.)
--prompt=nameSet the mariadb prompt to this value. See for options.
--protocol=nameThe protocol to use for connection (tcp, socket, pipe, memory).
-q, --quickDon't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.
--quick-max-column-width=NMaximal field length limit in case of --quick.
This option is not available.
-r, --rawFor tabular output, the “boxing” around columns enables one column value to be distinguished from another. For nontabular output (such as is produced in batch mode or when the --batch or --silent option is given), special characters are escaped in the output so they can be identified easily. Newline, tab, NUL, and backslash are written as \n, \t, \0, and \\. The --raw option disables this character escaping.
--reconnectReconnect if the connection is lost. This option is enabled by default. Disable with --disable-reconnect or skip-reconnect.
-U, --safe-updatesAllow only those and statements that specify which rows to modify by using key values. If you have set this option in an option file, you can override it by using --safe-updates on the command line. See for more.
--sandboxDisallow commands that access the file system (except \P without an argument and \e). Disabled commands include system (\!), tee (\T), pager with an argument(\P`` foo), source (\.). Using a disabled command is an error, which can be ignored with --force. A sandbox command (\-) enables the sandbox mode until EOF (current file or the session, if interactive).
This option is not available.
--script-dirSets an alternative directory path for searching scripts invoked via the source command.
This option is not available.
--secure-authRefuse client connecting to server if it uses old (pre-MySQL4.1.1) protocol. Defaults to FALSE.
--select-limit=numAutomatic limit for SELECT when using --safe-updates. Default 1000.
--server-arg=nameSend embedded server this as a parameter.
--shared-memory-base-name=nameShared-memory name to use for Windows connections using shared memory to a local server (started with the --shared-memory option). Case-sensitive.
--show-serveroutputEnables displaying of DBMS_OUTPUT messages. See for details.
--show-warningsShow warnings after every statement. Applies to interactive and batch mode.
--sigint-ignoreIgnore SIGINT signals (usually CTRL-C).
-s, --silentBe more silent. This option can be given multiple times to produce less and less output. This option results in nontabular output format and escaping of special characters. Escaping may be disabled by using raw mode; see the description for the --raw option.
--skip-auto-rehashDisable automatic rehashing. See --auto-rehash.
-N, --skip-column-namesDon't write column names in results. See --column-names.
--skip-commentsDiscard comments. Set by default, see --comments to enable.
-L, --skip-line-numbersDon't write line number for errors. See --line-numbers.
--skip-progress-reportsDisables getting for long running commands. See --progress-reports.
--skip-reconnectDon't reconnect if the connection is lost. See --reconnect.
-S, --socket=nameFor connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. The socket file can exist in different locations depending on setup. Common locations include:
Debian-based, Ubuntu: /var/run/mysqld/mysqld.sock
SUSE: /var/run/mysql/mysql.sock
Red Hat: /var/lib/mysql/mysql.sock
--sslEnables . 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.
TLS with --ssl is enabled by default.
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=nameDefines 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=nameDefines 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 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 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=nameDefines a path to the X509 certificate file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
--ssl-cipher=nameList of permitted ciphers or cipher suites to use for . This option implies the --ssl option.
--ssl-crl=nameDefines 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=nameDefines 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=nameDefines a path to a private key file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
--ssl-verify-server-certEnables . This option is enabled by default. Use --disable-ssl or --disable-ssl-verify-server-cert to revert this behavior.
Enables . This option is disabled by default.
-t, --tableDisplay output in table format. This is the default for interactive use, but can be used to produce table output in batch mode.
--tee=nameAppend everything into outfile. See interactive help (\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.
--tls-version=nameThis 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.
--ssl-fp=nameServer certificate fingerprint (implies --ssl).
--ssl-fplist=nameFile with accepted server certificate fingerprints, one per line (implies --ssl).
-n, --unbufferedFlush buffer after each query.
-u, --user=nameUser for login if not current user.
-v, --verboseWrite more. (-v -v -v gives the table output format).
-V, --versionOutput version information and exit.
-E, --verticalPrint the output of a query (rows) vertically. Use the \G delimiter to apply to a particular statement if this option is not enabled.
-w, --waitIf the connection cannot be established, wait and retry instead of aborting.
-X, --xmlProduce XML output. See the for more.
In addition to reading options from the command line, mariadb can also read options from . If an unknown option is provided to mariadb 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:
mariadb is linked with . However, MariaDB Connector/C does not handle the parsing of option files for this client. That is performed by the server option file parsing code. See for more information.
mariadb reads options from the following from :
The default delimiter in the client is the semicolon.
When creating from the command line, it is likely you will need to differentiate between the regular delimiter and a delimiter inside a block. Consider the following example:
If you enter the above line by line, the mariadb client will treat the first semicolon, at the end of the DECLARE x TINYINT line, as the end of the statement. Since that's only a partial definition, it will throw a syntax error, as follows:
The solution is to for the duration of the process, using the DELIMITER. The delimiter can be any set of characters you choose, but it needs to be a distinctive set of characters that won't cause further confusion. // is a common choice, and used throughout the documentation.
Here's how the function can be entered, using the new delimiter:
At the end, the delimiter is restored to the default semicolon. The \g and \G delimiters can always be used, even when a custom delimiter is specified.
You can force which protocol are used to connect to the mariadbd server, by giving the protocol option one of the following values: tcp, socket, pipe , or memory.
A connection property specified via the command line (e.g. --port=3306) forces its type. The protocol that matches the respective connection property is used. For instance, a TCP/IP connection is created when --port is specified.
If protocol is not specified, command-line connection properties that do not force protocol are ignored.
If multiple or no connection properties are specified via the command line, the following happens on Unix and Windows systems:
Unix
If hostname is not specified or hostname is localhost, Unix sockets are used.
In other cases (hostname is given and it's not localhost) then a TCP/IP connection through the port option is used.
localhost is a special value. Using 127.0.0.1 is not the same thing. The latter will connect to the mariadbd server through TCP/IP.
Windows
If shared-memory-base-name is specified and hostname is not specified or hostname is localhost, then the connection will happen through shared memory.
If shared-memory-base-name is not specified and hostname is not specified or hostname is localhost
The status command shows you information about which protocol is used:
There are also a number of commands that can be run inside the client. Note that all text commands must be first on the line and end with a semicolon (;).
On Unix, the mariadb client writes a record of executed statements to a history file. By default, this file is named .mysql_history and is created in your home directory. To specify a different file, set the value of the MYSQL_HISTFILE environment variable.
The .mysql_history file should be protected with a restrictive access mode because sensitive information might be written to it, such as the text of SQL statements that contain passwords.
If you do not want to maintain a history file, first remove .mysql_history if it exists, and use either of the following techniques:
Set the MYSQL_HISTFILE variable to /dev/null. To cause this setting to take effect each time you log in, put the setting in one of your shell's startup files.
Create .mysql_history as a symbolic link to /dev/null:
You need do this only once.
The prompt command reconfigures the default prompt \N [\d]>. The string for defining the prompt can contain the following special sequences.
This section describes some techniques that can help you use mariadb more effectively.
Some query results are much more readable when displayed vertically, instead of in the usual horizontal table format. Queries can be displayed vertically by terminating the query with \G instead of a semicolon (;). For example, longer text values that include newlines often are much easier to read with vertical output:
For beginners, a useful startup option is --safe-updates (or--i-am-a-dummy, which has the same effect). It is helpful for cases when you might have issued aDELETE FROM tbl_name statement but forgotten theWHERE clause. Normally, such a statement deletes all rows from the table. With --safe-updates, you can delete rows only by specifying the key values that identify them. This helps prevent accidents.
When you use the --safe-updates option, mariadb issues the following statement when it connects to the MariaDB server:
The statement has the following effects:
You are not allowed to execute an or statement unless you specify a key constraint in the WHERE clause or provide a LIMIT clause (or both). For example:
The server limits all largeSELECT results to 1,000 rows unless the statement includes a LIMIT clause.
The server aborts multiple-table SELECT statements that probably need to examine more than 1,000,000 row combinations.
To specify limits different from 1,000 and 1,000,000, you can override the defaults by using the --select_limit and --max_join_size options:
If the mariadb client loses its connection to the server while sending a statement, it immediately and automatically tries to reconnect once to the server and send the statement again. However, even if mariadb succeeds in reconnecting, your first connection has ended and all your previous session objects and settings are lost: temporary tables, the autocommit mode, and user-defined and session variables. Also, any current transaction rolls back. This behavior may be dangerous for you, as in the following example where the server was shut down and restarted between the first and second statements without you knowing it:
The @a user variable has been lost with the connection, and after that, the reconnection it is undefined. If it is important to have mariadb terminate with an error if the connection has been lost, you can start the mariadb client with the --skip-reconnect option.
This page is licensed: CC BY-SA / Gnu FDL
/tmp/mysql.sockNamed pipes will also be used if the libmysql / libmariadb client library detects that the client doesn't support TCP/IP.
In other cases, a TCP/IP connection through the port option is used.
ego, \G
Send command to mariadb server, display result vertically.
exit, \q
Exit mariadb. Same as quit.
go, \g
Send command to mariadb server.
help, \h
Display this help.
nopager,
Disable pager, print to stdout.
noserveroutput, \o
Disables displaying of DBMS_OUTPUT messages. See for details.
notee,
Don't write into outfile.
pager, \P
Set PAGER [to_pager]. Print the query results via PAGER.
print, \p
Print current command.
prompt,
Change your mariadb prompt.
quit, \q
Quit mariadb.
rehash, #
Rebuild completion hash.
serveroutput, \O
Enables displaying of DBMS_OUTPUT messages. See for details.
source, .
Execute an SQL script file. Takes a file name as an argument. Usually looks in the working directory, unless, from MariaDB 12.0, a path is given with --script-dir.
status, \s
Get status information from the server.
system, !
Execute a system shell command. Only works in Unix-like systems.
tee, \T
Set outfile [to_outfile]. Append everything into given outfile.
use, \u
Use another database. Takes database name as argument.
charset, \C
Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings, \W
Show warnings after every statement.
nowarning, \w
Don't show warnings after every statement.
\n
A newline character.
\O
The current month in three-letter format (Jan, Feb, ...).
\o
The current month in numeric format.
\P
am/pm.
\p
The current TCP/IP port or socket file.
\R
The current time, in 24-hour military time (0–23).
\r
The current time, standard 12-hour time (1–12).
\S
Semicolon.
\s
Seconds of the current time.
\t
A tab character.
\U
Your full user_name@host_name account name.
\u
Your user name.
\v
The server version.
\w
The current day of the week in three-letter format (Mon, Tue, ...).
\Y
The current year, four digits.
\y
The current year, two digits.
_
A space.
\
A space (a space follows the backslash).
'
Single quote.
"
Double quote.
\\
A literal “\” backslash character.
\x
x, for any “x” not listed above.
--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. If not set, MariaDB checks the $MYSQL_GROUP_SUFFIX environment variable. From MariaDB 12.0.1, MariaDB 11.8.2, MariaDB 11.4.6, MariaDB 10.11.12, $MARIADB_GROUP_SUFFIX is also checked, and takes precedence if both are set.
[mysql]
Options read by mysql, which includes both MariaDB Server and MySQL Server.
[mariadb-client]
Options read by mariadb.
[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.
-
Enables sandbox mode until EOF (current file or the session, if interactive). From MariaDB 10.5.25, MariaDB 10.6.18, MariaDB 10.11.8, MariaDB 11.0.6, MariaDB 11.1.5, MariaDB 11.2.4, MariaDB 11.4.2.
?, ?
Synonym for `help'.
clear, \c
Clear the current input statement.
connect,
Reconnect to the server. Optional arguments are db and host.
delimiter, \d
Set statement delimiter.
edit, \e
Edit command with $EDITOR.
\c
A counter that increments for each statement you issue.
\D
The full current date.
\d
The default database.
\h
The server host.
\l
The current delimiter.
\m
Minutes of the current time.
mariadb db_namemariadb --user=user_name --password=your_password db_namemariadb db_name < script.sql > output.tabmariadb <options>CREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC
BEGIN
DECLARE x TINYINT;
SET x = 42;
RETURN x;
END;CREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC
BEGIN
DECLARE x TINYINT;
ERROR 1064 (42000): You have an error in your SQL syntax;
check the manual that corresponds to your MariaDB server version
for the right syntax to use near '' at line 3DELIMITER //
CREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC
BEGIN
DECLARE x TINYINT;
SET x = 42;
RETURN x;
END
//
DELIMITER ;shell> mariadb test
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 11.4.1-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [test]> status;
--------------
mysql Ver 15.1 Distrib 10.0.25-MariaDB, for Linux (x86_64) using readline 5.2
Connection id: 10
Current database: test
Current user: monty@localhost
...
Connection: Localhost via UNIX socket
...
UNIX socket: /tmp/mysql-dbug.sockshell> ln -s /dev/null $HOME/.mysql_historymariadb> SELECT * FROM mails WHERE LENGTH(txt) < 300 LIMIT 300,1\G
*************************** 1. row ***************************
msg_nro: 3068
date: 2000-03-01 23:29:50
time_zone: +0200
mail_from: Monty
reply: monty@no.spam.com
mail_to: "Thimble Smith" <tim@no.spam.com>
sbj: UTF-8
txt: >>>>> "Thimble" == Thimble Smith writes:
Thimble> Hi. I think this is a good idea. Is anyone familiar
Thimble> with UTF-8 or Unicode? Otherwise, I´ll put this on my
Thimble> TODO list and see what happens.
Yes, please do that.
Regards,
Monty
file: inbox-jani-1
hash: 190402944
1 row in set (0.09 sec)SET sql_safe_updates=1, sql_select_limit=1000, sql_max_join_size=1000000;UPDATE tbl_name SET not_key_column=val WHERE key_column=val;
UPDATE tbl_name SET not_key_column=val LIMIT 1;mariadb --safe-updates --select_limit=500 --max_join_size=10000mariadb> SET @a=1;
Query OK, 0 rows affected (0.05 sec)
mariadb> INSERT INTO t VALUES(@a);
ERROR 2006: MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: test
Query OK, 1 row affected (1.30 sec)
mariadb> SELECT * FROM t;
+------+
| a |
+------+
| NULL |
+------+The mariadb-dump client is a backup program originally written by Igor Romanenko.
mariadb-dump generates a command at the beginning of the dump to enable sandbox mode. This command cannot be interpreted by earlier versions of the mariadb command-line client or by the MySQL command-line client mysql – an error is thrown if used against client versions that do not support it. This does not affect other methods of importing the data.
mariadb-dump is used to dump a database or a collection of databases for backup, or transferring data to another database server (not necessarily MariaDB or MySQL). The dump contains SQL statements to create databases, tables, table data, and more. It can also be used to generate files in CSV, XML, or other formats that use delimiters.
mariadb-dump dumps triggers along with tables, as these are part of the table definition. However, , , and are not dumped, and need extra parameters to be recreated explicitly (for example, --routines and --events). and are also part of the system tables (for example, ).
mariadb-dump supports the .
mariadb-dump doesn't consume much CPU – by default, it uses a single thread. This method is good for a heavily loaded server.
Disk input/output per second (IOPS) can, however, increase for multiple reasons. When backing up on the same device as the database, this produces unnecessary random IOPS. The dump is done sequentially, on a per-table basis, causing a full table scan and many buffer page misses on tables that are not fully cached in memory.
It's recommended that you back up from a network location to remove disk IOPS on the database server, but it is vital to use a separate network card to keep network bandwidth available for regular traffic.
Although mariadb-dump by default preserves your resources for regular spindle disks and low-core hardware, this doesn't mean that concurrent dumps cannot benefit from hardware architecture like SAN, flash storage, low write workload. The backup time would benefit from a tool such as MyDumper.
There are four general ways to invoke mariadb-dump:
If you do not name any tables after specifying db_name , or if you use the --databases or --all-databases option, entire databases are dumped.
mariadb-dump does not dump the INFORMATION_SCHEMA (or PERFORMANCE_SCHEMA, if enabled) database by default. MariaDB dumps the INFORMATION_SCHEMA if you name it explicitly on the command line, although you must also use the --skip-lock-tables option.
To see a list of the options your version of mariadb-dump supports, execute mariadb-dump --help.
mariadb-dump can retrieve and dump table contents row by row, or it can retrieve the entire content from a table and buffer it in memory before dumping it. Buffering in memory can be a problem if you are dumping large tables. To dump tables row by row, use the --quick option (or --opt, which enables --quick). The --opt option (and hence --quick) is enabled by default, so to enable memory buffering, use --skip-quick.
mariadb-dump includes logic to cater for the .
If you are using a recent version of mariadb-dump to generate a dump to be reloaded into a very old MySQL server, you should not use the --opt or --extended-insert option. Use --skip-opt instead.
mariadb-dump supports the following options:
Deprecated. Use --create-options instead.
Dump all the databases. This is the same as --databases with all databases selected.
Dump all the tablespaces.
Do not dump any tablespace information.
Add a before each create. Typically used in conjunction with the --all-databases or --databases option, because no statements are written, unless one of those options is specified.
Add a before each create.
Add a statement before each .
Add locks around statements, which results in faster inserts when the dump file is reloaded. Use --skip-add-locks to disable.
Allow creation of column names that are keywords. This works by prefixing each column name with the table name.
Adds prior to and to bottom of dump.
Dump as of specified timestamp. Argument is interpreted according to the --tz-utc setting. Table structures are always dumped as of current timestamp. This option is available from MariaDB 10.7.
Directory for files.
Write additional information in the dump file such as program version, server version, and host. Disable with --skip-comments.
Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables the --skip-add-drop-table, --skip-add-locks, --skip-comments, --skip-disable-keys, and --skip-set-charset options.
Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MariaDB and MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, and no_field_options. You can use several modes, separated by commas. This option does not guarantee compatibility with other servers. It only enables those SQL mode values that are available for making dump output more compatible. For example, --compatible=oracle does not map data types to Oracle types or use Oracle comment syntax.
Use complete statements that include column names.
Use compression in server/client protocol. Both client and server must support compression for this to work.
By default, tables are ignored. With this option set, the result file will contain a CREATE statement for a similar table, followed by the table data and ending with an ALTER TABLE`` ``table`` ``ENGINE=S3.
Include all MariaDB and/or MySQL specific create options in CREATE TABLE statements. Use --skip-create-options to disable.
Dump several databases. Normally, mariadb-dump treats the first name argument on the command line as a database name and following names as table names. With this option, it treats all name arguments as database names. and statements are included in the output before each new database.
If using a debug version of MariaDB, write a debugging log. A typical debug_options string is d:t:o,file_name. The default value is d:t:o,/tmp/mysqldump.trace. If using a non-debug version, mariadb-dump will catch this and exit.
Check memory and open file usage at exit.
Print some debug info at exit.
Default authentication client-side plugin to use.
Set the default to name. If no character set is specified, mariadb-dump uses utf8mb4.
Read the file name after the global files are read. Must be given as the first argument.
Only read default options from the given file name. Must be given as the first argument.
Also read groups with a suffix of str. For example, since mariadb-dump normally reads the [client] and [mariadb-dump] (or [mysqldump]) groups, --defaults-group-suffix=x would cause it to also read the groups [mariadb-dump_x] (or [mysqldump_x]) and [client_
Insert rows with instead of .
On a primary replication server, delete the binary logs by sending a statement to the server after performing the dump operation. This option automatically enables --master-data=2.
Parallel dump of multiple databases. Works just like --tab, with regard to output (sql file for table definition and tab-separated for data, same options, for example, --parallel). It also allows the --databases and --all-databases options. When --dir is used, it creates the directory structure in the output directory pointed to by --dir. For every database to be dumped, there is a directory with the database name. All options that --tab supports are also supported by --dir, in particular --parallel. This option is available from MariaDB 11.5.
'/*!40000 ALTER TABLE`` ``tb_name``DISABLE KEYS``/; and '/!40000 ALTER TABLE`` ``tb_name`` ``ENABLE KEYS */; are written to the output. This makes loading the dump file faster, because the indexes are created after all rows are inserted. This option is effective only for non-unique indexes of MyISAM tables. Disable with --skip-disable-keys.
If the --comments option and this option are given, mariadb-dump produces a comment at the end of the dump of the following form: -- Dump completed on`` ``date. However, the date causes dump files taken at different times to appear to be different, even if the data are otherwise identical. --dump-date and --skip-dump-date control whether the date is added to the comment. The default is --dump-date (include the date in the comment). --skip-dump-date suppresses date printing.
Dump tables with . This option is available from MariaDB 10.11. Until this option was introduced, mariadb-dump could not read historical rows from versioned tables, and so historical data would not be backed up.
Used for producing a dump file from a replica server that can be used to set up another replica server with the same primary. Causes the position and filename of the primary to be appended to the dumped data output. Setting the value to 1 (the default) prints it as a command in the dumped data output; if set to 2, that command is prefixed with a comment symbol. This option will turn on --lock-all-tables, unless --single-transaction is specified, too (in which case a global read lock is only taken a short time at the beginning of the dump. Make sure to read about --single-transaction below). In all cases, any action on logs happens at the exact moment of the dump. This option automatically turns off --lock-tables.
This option pauses any running SQL threads during the dump.
This option stops any running SQL threads before the dump, and restarts all stopped IO and SQL threads after completion.
Include for the dumped databases in the output.
Use multiple-row syntax that include several values lists. This results in a smaller dump file and speeds up inserts when the file is reloaded. Defaults to ON; use --skip-extended-insert to disable.
Fields in the output file are terminated by the given string. Used with the --tab option and has the same meaning as the corresponding FIELDS clause for .
Fields in the output file are enclosed by the given character. Used with the --tab option and has the same meaning as the corresponding FIELDS clause for .
Fields in the output file are optionally enclosed by the given character. Used with the --tab option and has the same meaning as the corresponding FIELDS clause for .
Fields in the output file are escaped by the given character. Used with the --tab option and has the same meaning as the corresponding FIELDS clause for .
Removed in MariaDB 5.5. Use --lock-all-tables instead.
Flush the MariaDB server log files before starting the dump. This option requires the . If you use this option in combination with the --databases= or --all-databases option, the logs are flushed for each database dumped. The exception is when using --lock-all-tables or --master-data: In this case, the logs are flushed only once, corresponding to the moment all tables are locked. If you want your dump and the log flush to happen at the same exact moment, you should use --flush-logs together with either --lock-all-tables or --master-data.
Send a statement to the server after dumping the . This option should be used any time the dump contains the mysql database and any other database that depends on the data in the mysql database for proper restoration.
Continue even if an SQL error occurs during a table dump.One use for this option is to cause mariadb-dump to continue executing even when it encounters a view that has become invalid because the definition refers to a table that has been dropped. Without --force in this example, mariadb-dump exits with an error message. With --force, mariadb-dump prints the error message, but it also writes an SQL comment containing the view definition to the dump output and continues executing.
Used together with --master-data and --dump-slave to more conveniently set up a new replica. It causes those options to output SQL statements that configure the replica to use the to connect to the primary instead of old-style filename/offset positions. The old-style positions are still included in comments when --gtid is used; likewise the GTID position is included in comments even if --gtid is not used.
Display a help message and exit.
Dump binary strings in hexadecimal format (for example, ´abc´ becomes 0x616263). The affected data types are , , the types, and .
Connect to and dump data from the MariaDB or MySQL server on the given host. The default host is localhost.
Do not dump the specified database. To specify more than one database to ignore, use the directive multiple times, once for each database. Only takes effect when used together with --all-databases or -A.
Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names, for example, --ignore-table=database.table. This option also can be used to ignore views.
Do not dump the specified table data (only the structure). To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names. See also --no-data.
Add the MASTER_HOST and MASTER_PORT options for the statement when using the --dump-slave option for a replica dump.
Insert rows with INSERT IGNORE instead of INSERT.
Lines in the output file are terminated by the given string. This option is used with the --tab option and has the same meaning as the corresponding LINES clause for .
Lock all tables across all databases. This is achieved by acquiring a global read lock for the duration of the whole dump by executing . This option automatically turns off
--single-transaction and --lock-tables.
For each dumped database, lock all tables to be dumped before dumping them. The tables are locked with READ LOCAL to allow concurrent inserts in the case of tables. For transactional tables such as , --single-transaction is a much better option than --lock-tables because it does not need to lock the tables at all. Because --lock-tables locks tables for each database separately, this option does not guarantee that the tables in the dump file are logically consistent between databases. Tables in different databases may be dumped in completely different states. Use --skip-lock-tables to disable.
Log warnings and errors by appending them to the named file. The default is no logging.
When restoring the dump, if logging is turned on, the server logs queries to the general and . Defaults to ON; use --skip-log-queries to disable.
Causes the position and filename to be appended to the output, useful for dumping a primary replication server to produce a dump file that can be used to set up another server as a replica of the primary. These are the primary server coordinates from which the replica should start replicating after you load the dump file into the replica.
If the option is set to 1 (the default), print it as a command; if set to 2, that command is prefixed with a comment symbol. This --master-data option turns --lock-all-tables on, unless --single-transaction is specified, too. In all cases, any action on logs will happen at the exact moment of the dump. This option automatically turns --lock-tables off. In all cases, any action on logs happens at the exact moment of the dump. It is also possible to set up a replica by dumping an existing replica of the primary. To do this, use the following procedure on the existing replica:
Stop the SQL thread of the replica and get its current status.
From the output of the SHOW REPLICA STATUS statement, the binary log coordinates of the primary server from which the new replica should start replicating are the values of the Relay_Master_Log_File and Exec_Master_Log_Pos fields. Denote those values as file_name and file_pos.
The maximum packet length to send to or receive from server. The maximum is 1GB.
Sets the maximum time any statement can run before being timed out by the server. Default value is 0 (no limit).
The initial buffer size for client/server TCP/IP and socket communication. This can be used to limit the size of rows in the dump. When creating multiple-row INSERT statements (as with the --extended-insert or --opt option), mariadb-dump creates rows up to net_buffer_length length.
Enclose the statements for each dumped table within and statements. ON by default from MariaDB 11.8 to allow faster data loading by InnoDB, writing only one undo log for the whole operation.
This option suppresses the statement that normally is output for each dumped database if --all-databases or --databases is given.
Do not write statements which re-create each dumped table.
Do not write any table row information (that is, do not dump table contents). This is useful if you want to dump only the statement for the table (for example, to create an empty copy of the table by loading the dump file). See also --ignore-table-data.
Do not dump rows for engines that manage external data (for instance, , MRG_ISAM, , , , VP, ). This option is enabled by default. If you want to dump data for these engines, you need to set --no-data-med=0.
Don't read default options from any option file. Must be given as the first argument.
Suppress the SET NAMES statement. This has the same effect as --skip-set-charset.
This option is shorthand. It is the same as specifying --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt. It should give you a fast dump operation and produce a dump file that can be reloaded into a MariaDB server quickly. The --opt option is enabled by default. Use --skip-opt to disable it. See the discussion at the beginning of this section for information about selectively enabling or disabling a subset of the options affected by --opt
Sorts each table's rows by primary key, or first unique key, if such a key exists. This is useful when dumping a table to be loaded into an table, but will make the dump itself take considerably longer.
Dump each table according to their size, smallest first. Useful when using --single-transaction on tables which get truncated/altered often. The assumption here is that smaller tables get truncated more often, and by dumping those first, this reduces the chance that a --single-transaction dump will fail with 'Table definition has changed, please retry transaction'. This option is available from MariaDB 10.9.1.
Number of dump table jobs executed in parallel (only for use with the --tab option). Testing indicates that performance can be increased (dump time decreased) up to 4 times on smaller size dumps, when the database fits into memory. There is a point at which the disk becomes the bottleneck, after which adding more parallel jobs does not bring better performance. From MariaDB 11.4.1.
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 --password or -p option on the command line, mariadb-dump prompts for one. 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.
On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections.
Directory for client-side plugins.
The TCP/IP port number to use for the connection.
Print the program argument list and exit. Must be given as the first argument.
The connection protocol to use for connecting to the server (TCP, SOCKET, PIPE, MEMORY). It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want.
This option is useful for dumping large tables. It forces mariadb-dump to retrieve rows for a table from the server a row at a time and to then dump the results directly to stdout rather than retrieving the entire row set and buffering it in memory before writing it out. Defaults to ON, use --skip-quick to disable.
Quote identifiers (such as database, table, and column names) within backtick (`) characters. If the ANSI_QUOTES SQL mode is enabled, identifiers are quoted with (") characters. This option is enabled by default. It can be disabled with --skip-quote-names, but this option should be given after any option such as --compatible that may enable --quote-names.
Use statements instead of statements.
Direct output to a given file. This option should be used on Windows, to prevent newline (\n) characters from being converted to \r\n carriage return/newline sequences. The result file is created and its previous contents overwritten, even if an error occurs while generating the dump.
Include stored routines ( and ) for the dumped databases in the output. Use of this option requires the SELECT privilege for the table. The output generated using --routines contains and statements to re-create the routines. However, these statements do not include attributes such as the routine creation and modification timestamps. This means that when the routines are reloaded, they are created with the timestamps equal to the reload time.If you require routines to be re-created with their original timestamp attributes, do not use --routines. Instead, dump and reload the contents of the table directly, using a MariaDB account which has appropriate privileges for the mysql database.
Add 'SET NAMES default_character_set' to the output in order to set the . Enabled by default; suppress with --skip-set-charset.
Change the value of a variable. This option is deprecated; you can set variables directly with --variable-name=value.
Shared-memory name to use for Windows connections using shared memory to a local server (started with the --shared-memory option). Case-sensitive. Defaults to MYSQL.
This option sends a SQL statement to the server before dumping data. It is useful only with transactional tables such as , because then it dumps the consistent state of the database at the time when BEGIN was issued, without blocking any applications. When using this option, you should keep in mind that only InnoDB tables are dumped in a consistent state. The single-transaction feature depends not only on the engine being transactional and capable of REPEATABLE-READ, but also on START TRANSACTION WITH CONSISTENT SNAPSHOT. The dump is not guaranteed to be consistent for other storage engines. For example, any , or tables dumped while using this option may still change state. While a --single-transaction dump is in process, to ensure a valid dump file (correct table contents and binary log coordinates), no other connection should use the following statements: , , , , or . A consistent read is not isolated from those statements, so use of them on a table to be dumped can cause the SELECT (performed by mariadb-dump to retrieve the table contents) to obtain incorrect contents or fail. The --single-transaction option and the --lock-tables option are mutually exclusive, because
Disable the --add-locks option.
Disable the --comments option.
Disable the --disable-keys option.
Disable the --extended-insert option.
Disable the --opt option (disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys).
Disable the --quick option.
Disable the --quote-names option.
Disable the --set-charset option.
Disable the --triggers option.
Disable the --tz-utc option.
For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
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.
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.
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 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 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.
Defines a path to the X509 certificate file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
List of permitted ciphers or cipher suites to use for . This option implies the --ssl option.
Defines 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.
Defines 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.
Defines a path to a private key file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
Enables . This option is disabled by default.
Dump the database's system tables in a logical form. With this option, the tables are dumped as , and other forms of logical portable SQL statements. The option values here are from the set of all, users, plugins, udfs, servers, stats, timezones.
Produce tab-separated text-format data files. With this option, for each dumped table, mariadb-dump creates a tbl_name.sql file containing the CREATE TABLE statement that creates the table, and a tbl_name.txt file containing the table's data. The option value is the directory in which to write the files. Note: This option can only be used when mariadb-dump is run on the same machine as the mariadbd server. You must have the FILE privilege, and the server must have permission to write files in the directory that you specify. By default, the .txt data files are formatted using tab characters between column values, and a newline at the end of each line. The format can be specified explicitly using the --fields-xxx and --lines-terminated-by
This option overrides the --databases (-B) option. mariadb-dump regards all name arguments following the option as table names.
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.
Include for each dumped table in the output. This option is enabled by default; disable it with --skip-triggers.
This option enables columns to be dumped and reloaded between servers in different time zones. mariadb-dump sets its connection time zone to UTC and adds SET TIME_ZONE=´+00:00´ to the dump file. Without this option, TIMESTAMP columns are dumped and reloaded in the time zones local to the source and destination servers, which can cause the values to change if the servers are in different time zones. --tz-utc also protects against changes due to daylight saving time. --tz-utc is enabled by default. To disable it, use --skip-tz-utc.
The MariaDB user name to use when connecting to the server.
Verbose mode. Print more information about what the program is doing during various stages.
Output version information and exit.
Dump only rows selected by the given WHERE condition. Quotes around the condition are mandatory if it contains spaces or other characters that are special to your command interpreter. Example:
--where="user = ´jimf´" -w"userid > 1" -w"userid < 1" .
Usage of wildcards in the table/database name. Without the --databases option, wildcards can be used only in tables names. From .
Dump a database as well-formed XML.
Some mariadb-dump options are shorthand for groups of other options:
Use of --opt is the same as specifying--add-drop-table, --add-locks,--create-options, --disable-keys,--extended-insert, --lock-tables,--quick, and --set-charset. All of the
options that --opt stands for also are on by default because --opt
To reverse the effect of a group option, uses its --skip-xxx form (--skip-opt or --skip-compact). It
is also possible to select only part of the effect of a group option by following it with options that enable or disable specific features. Here are some examples:
To select the effect of --opt except for some features, use the --skip option for each feature. To disable extended inserts and memory buffering, use --opt--skip-extended-insert --skip-quick.
(Actually, --skip-extended-insert--skip-quick is sufficient because--opt is on by default.)
To reverse --opt for all features except index disabling and table locking, use --skip-opt--disable-keys
When you selectively enable or disable the effect of a group option, the order is important, because options are processed first to last. For example,--disable-keys --lock-tables--skip-opt would not have the intended effect; it is the same as --skip-opt by itself.
Some options, like --lines-terminated-by, accept a string. The string can be quoted, if necessary. For example, on Unix systems this is the option to enclose fields within double quotes:
An alternative is to specify the hexadecimal value of a character. For example, the following syntax works on any platform:
In addition to reading options from the command line, mariadb-dump can also read options from . If an unknown option is provided to mariadb-dump 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:
mariadb-dump is linked with . However, MariaDB Connector/C does not handle the parsing of option files for this client. That is performed by the server option file parsing code. See for more information.
mariadb-dump reads options from the following from :
For a column named column_name, the NULL value, an empty string, and the string value ´NULL´ are distinguished from one another in the output generated by this option as follows.
The output from the mariadb client when run using the --xml option also follows the preceding rules.
XML output from mariadb-dump includes the XML namespace, as shown here :
To restore a backup created with mariadb-dump, use the [mariadb client](../mariadb-client/mariadb-command line-client.md) to import the dump:
You can also set the following variables (--variable-name=value) and boolean options {FALSE|TRUE} by using:
A common use of mariadb-dump is making a backup of an entire database:
You can load the dump file back into the server like this:
Or like this:
mariadb-dump is also very useful for populating databases by copying data from one MariaDB server to another:
It is possible to dump several databases with one command:
To dump all databases, use the --all-databases option:
For InnoDB tables, mariadb-dump provides a way of making an online backup:
This backup acquires a global read lock on all tables (usingFLUSH TABLES WITH READ LOCK) at the beginning of the dump. As soon as this lock has been acquired, the binary log coordinates are read and the lock is released. If long updating statements are running when the FLUSH statement is issued, the MariaDB server may get stalled until those statements finish. After that, the dump becomes lock free and does not disturb reads and writes on the tables. If the update statements that the MariaDB server receives are short (in terms of execution time), the initial lock period should not be noticeable, even with many updates.
For point-in-time recovery (also known as “roll-forward,” when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the or at least know the binary log coordinates to which the dump corresponds:
Or:
The --master-data and --single-transaction options can be used simultaneously, which provides a convenient way to make an online backup suitable for use prior to point-in-time recovery if tables are
stored that use the InnoDB storage engine.
(video)
(video)
This page is licensed: CC BY-SA / Gnu FDL
x]Dump the replica server.
Restart the replica.
On the new replica, load the dump file.
On the new replica, set the replication coordinates to those of the primary server obtained earlier.
The CHANGE MASTER TO statement might also need other parameters, such as MASTER_HOST to point the replica to the correct primary server host. Add any such parameters as necessary.
--lock-tables. To dump large tables, you should combine the --single-transaction option with --quick.--default-character-setUse of --compact is the same as specifying--skip-add-drop-table,--skip-add-locks, --skip-comments,--skip-disable-keys, and--skip-set-charset options.
--lock-tablesadd-drop-trigger
FALSE
add-locks
TRUE
allow-keywords
FALSE
apply-slave-statements
FALSE
as-of
(No default value)
character-sets-dir
(No default value)
comments
TRUE
compatible
(No default value)
compact
FALSE
complete-insert
FALSE
compress
FALSE
copy-s3-tables
FALSE
create-options
TRUE
databases
FALSE
debug-check
FALSE
debug-info
FALSE
default-character-set
utf8mb4
delayed-insert
FALSE
delete-master-logs
FALSE
disable-keys
TRUE
events
FALSE
extended-insert
TRUE
fields-terminated-by
(No default value)
fields-enclosed-by
(No default value)
fields-optionally-enclosed-by
(No default value)
fields-escaped-by
(No default value)
flush-logs
FALSE
flush-privileges
FALSE
force
FALSE
hex-blob
FALSE
host
(No default value)
include-master-host-port
FALSE
insert-ignore
FALSE
lines-terminated-by
(No default value)
lock-all-tables
FALSE
lock-tables
TRUE
log-error
(No default value)
log-queries
TRUE
master-data
0
max_allowed_packet
16777216
net-buffer-length
1046528
no-autocommit
TRUE (> MariaDB 11.7), FALSE (< MariaDB 11.8)
no-create-db
FALSE
no-create-info
FALSE
no-data
FALSE
no-data-med
TRUE
order-by-primary
FALSE
port
0
quick
TRUE
quote-names
TRUE
replace
FALSE
routines
FALSE
set-charset
TRUE
single-transaction
FALSE
dump-date
TRUE
socket
No default value)
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
system
(No default value)
tab
(No default value)
triggers
TRUE
tz-utc
TRUE
user
(No default value)
verbose
FALSE
where
(No default value)
plugin-dir
(No default value)
default-auth
(No default value)
--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.
[mysqldump]
Options read by mariadb-dump, which includes both MariaDB Server and MySQL Server.
[mariadb-dump]
Options read by mariadb-dump.
[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.
NULL (unknown value)
<field name="column_name" xsi:nil="true" />
'' (empty string)
<field name="column_name"></field>
'NULL' (string value)
<field name="column_name">NULL</field>
all
TRUE
all-databases
FALSE
all-tablespaces
FALSE
no-tablespaces
FALSE
add-drop-database
FALSE
add-drop-table
TRUE
mariadb-dump --master-data=2 --all-databases > dumpfileSTART REPLICA;mariadb < dumpfileCHANGE MASTER TO
MASTER_LOG_FILE = ´file_name´,
MASTER_LOG_POS = file_pos;shell> mariadb-dump [options] db_name [tbl_name ...]
shell> mariadb-dump [options] --databases db_name ...
shell> mariadb-dump [options] --all-databases
shell> mariadb-dump [options] --system=[option_list]STOP SLAVE SQL_THREAD;
SHOW REPLICA STATUS;--fields-enclosed-by='"'--fields-enclosed-by=0x22shell> mariadb-dump --xml -u root world City
<?xml version="1.0"?>
<mariadb-dump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="world">
<table_structure name="City">
<field Field="ID" Type="int(11)" Null="NO" Key="PRI" Extra="auto_increment" />
<field Field="Name" Type="char(35)" Null="NO" Key="" Default="" Extra="" />
<field Field="CountryCode" Type="char(3)" Null="NO" Key="" Default="" Extra="" />
<field Field="District" Type="char(20)" Null="NO" Key="" Default="" Extra="" />
<field Field="Population" Type="int(11)" Null="NO" Key="" Default="0" Extra="" />
<key Table="City" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="ID"
Collation="A" Cardinality="4079" Null="" Index_type="BTREE" Comment="" />
<options Name="City" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="4079"
Avg_row_length="67" Data_length="273293" Max_data_length="18858823439613951"
Index_length="43008" Data_free="0" Auto_increment="4080"
Create_time="2007-03-31 01:47:01" Update_time="2007-03-31 01:47:02"
Collation="latin1_swedish_ci" Create_options="" Comment="" />
</table_structure>
<table_data name="City">
<row>
<field name="ID">1</field>
<field name="Name">Kabul</field>
<field name="CountryCode">AFG</field>
<field name="District">Kabol</field>
<field name="Population">1780000</field>
</row>
...
<row>
<field name="ID">4079</field>
<field name="Name">Rafah</field>
<field name="CountryCode">PSE</field>
<field name="District">Rafah</field>
<field name="Population">92020</field>
</row>
</table_data>
</database>
</mariadb-dump>mariadb db_name < backup-file.sqlshell> mariadb-dump db_name > backup-file.sqlshell> mariadb db_name < backup-file.sqlshell> mariadb -e "source /path-to-backup/backup-file.sql" db_nameshell> mariadb-dump --opt db_name | mariadb --host=remote_host -C db_nameshell> mariadb-dump --databases db_name1 [db_name2 ...] > my_databases.sqlshell> mariadb-dump --all-databases > all_databases.sqlshell> mariadb-dump --all-databases --single-transaction all_databases.sqlshell> mariadb-dump --all-databases --master-data=2 > all_databases.sqlshell> mariadb-dump --all-databases --flush-logs --master-data=2 > all_databases.sql