All pages
Powered by GitBook
1 of 35

Frequently Asked Questions

There are many questions that are frequently asked about MariaDB, the organizations and the software. They have been grouped based on common topics. Click on a topic to find the question you may have. If you don't see it, please click on the button in the left margin labeled, "Ask a Question Here". We'll try to answer you question, quickly.

MariaDB Community Server

  • Q: What is MariaDB Community Server and its main purpose? A: MariaDB Community Server is a popular free and open-source relational database management system (RDBMS), originally forked from MySQL. It is actively developed and maintained by MariaDB plc and a global community of contributors. It's known for its strong performance, stability, and a rich feature set suitable for a wide range of applications.

  • Q: Can MariaDB Community Server be used as a direct MySQL replacement? A: Yes, in many scenarios and for numerous versions, MariaDB Community Server is designed to be a compatible, drop-in replacement for MySQL, facilitating easy migration for users. However, as both MariaDB and MySQL evolve independently, some differences may exist in newer or more advanced features.

  • Q: What are the key benefits and features of MariaDB Community Server? A: Key benefits of MariaDB Community Server include its true open-source nature (GPLv2 license), a broader selection of advanced storage engines (like Aria, MyRocks, and Spider, in addition to the standard InnoDB), continuous feature enhancements, performance improvements, and the support of a vibrant, active global community.

  • Q: What license is MariaDB Community Server distributed under? A: MariaDB Community Server is licensed under the GNU General Public License version 2 (GPLv2), ensuring it remains free and open source.

  • Q: Where can I download MariaDB Community Server? A: You can download official MariaDB Community Server packages from the MariaDB Foundation website (mariadb.org). Additionally, it is readily available in the software repositories of most major Linux distributions for easy installation.

The mariadb-backup Tool

  • Q: What is mariadb-backup and its primary use? A: mariadb-backup is a command-line utility included with MariaDB Community Server. Its primary use is to perform physical "hot" backups of MariaDB database instances, especially those utilizing transactional storage engines like InnoDB and XtraDB. This tool is based on the well-regarded Percona XtraBackup technology.

  • Q: What are the main advantages of using mariadb-backup for database backups? A: The main advantages of mariadb-backup are its ability to perform online (hot) backups with minimal locking. This means your MariaDB database remains largely available for both read and write operations during the backup process. For large databases, mariadb-backup is generally much faster than logical backup methods (like mariadb-dump) and, when used in conjunction with MariaDB's binary logs, it enables precise point-in-time recovery (PITR).

  • Q: How does the mariadb-backup utility work to create backups? A: mariadb-backup works by copying the physical data files from the MariaDB data directory while the server is running. It continuously monitors for changes made to these files during the backup operation and records these modifications in a separate log file. In a subsequent "prepare" phase, these logged changes are applied to the copied data files to ensure they are brought to a transactionally consistent state, ready for restoration.

  • Q: Is mariadb-backup a suitable backup solution for all MariaDB storage engines? A: mariadb-backup is primarily designed for, and works most effectively with, transactional storage engines such as InnoDB and XtraDB, for which it can guarantee consistency and perform online backups. While it might be able to copy data files for other storage engines like Aria or MyISAM, it cannot ensure the same level of transactional consistency or perform true online backups for them. For non-transactional engines, mariadb-dump or filesystem-level snapshots might be more appropriate choices.

  • Q: Is the mariadb-backup tool free to use? A: Yes, mariadb-backup is an open-source tool that is included as a standard utility with MariaDB Community Server and is completely free to use.

Community Questions

How Can I Contribute to MariaDB?

There are many ways to contribute to MariaDB. If you want to contribute to, or participate in the development of MariaDB, there are many ways to do so. You don't have to be a developer (but we always welcome more of those), you just have to have the willingness to help make MariaDB better. For example, we are looking for writers or translators of KB articles and people helping setting up MariaDB discussions groups.

Contributing to the MariaDB Project is the page that gathers together everything you need to get started.

The community category contains a lot of interesting links about how to participate.

You can also consider sponsoring a feature.

Welcome to the MariaDB community!

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

DBA Questions

Developer Questions

How can a VBA Application Connect to MariaDB?

How can I Learn about Developing MariaDB?

See MariaDB Development for this.

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

How many JOIN Clauses are Allowed in a Query?

According to MySQL docs: joins-limits.html

The maximum number of tables that can be referenced in a single join is 61. This also applies to the number of tables that can be referenced in the definition of a view.

Does the same maximum (61) applies to MariaDB, too?

If yes, are there plans for raising this limit?

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

Remote connection work but often get error HY000/2002 connection timed out

Hi all,

I have create a remote connection between two linux server running mariadb. One run centos stream 9 with 10.5.16-MariaDB and the second run centos 7 with 5.5.68-MariaDB. Through php script automated with cron I run queries and it work.

The problem is that often i get the error HY000/2002 connection timed out. The error occurs at random times either using cron or launching it manually. For example, the script work for 10 times and on the 11th time I receive the error (HY000/2002 connection timed out) which can occur one or more times consecutively and then return to work on the umpteenth execution. The number of times the script works or not is always different.

I can't find the cause of the error. Any suggestions?

Thanks

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

Tools Available for Developing on the MariaDB Code

The code is hosted on server. You can branch the latest code from there, and you can also push your own changes as a new branch that can be shared with others.

Building the code from source is done with standard Unix tools: CMake (or autotools for MariaDB versions below 5.5), Gnu Make, GCC (or other C/C++ compiler on some systems). OnWindows, CMake and Visual Studio are used.

The current state of the source with respect to build/test failures can be seen in buildbot.

For project management and bug tracking, we use JIRA.

The source page has links to instructions on setting up a full development environment, if you are interested.

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

Where is the table_cache in MariaDB?

All versions of MariaDB are based on MySQL 5.1 and greater, thus the table_cache option is deprecated in favor of table_open_cache. This is also documented at: mariadbd Options.

For further reading, please refer to the MySQL manual: How MySQL Opens and Closes Tables.

Examples of use cases:

MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'opened_tables';
+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| Opened_tables | 354858 |
+---------------+--------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT @@table_open_cache;
+--------------------+
| @@table_open_cache |
+--------------------+
|                400 |
+--------------------+
1 row in set (0.00 sec)

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

Why is ORDER BY in a FROM Subquery Ignored?

Query with ORDER BY in a FROM subquery produces unordered result. Is this a bug? Below is an example of this:

SELECT field1, field2 FROM ( SELECT field1, field2 FROM table1 ORDER BY field2 ) alias

returns a result set that is not necessarily ordered by field2. This is not a bug.

A "table" (and subquery in the FROM clause too) is - according to the SQL standard - an unordered set of rows. Rows in a table (or in a subquery in the FROM clause) do not come in any specific order. That's why the optimizer can ignore the ORDER BY clause that you have specified. In fact, the SQL standard does not even allow the ORDER BY clause to appear in this subquery (we allow it, because ORDER BY ... LIMIT ... changes the result, the set of rows, not only their order).

You need to treat the subquery in the FROM clause, as a set of rows in some unspecified and undefined order, and put the ORDER BY on the top-level SELECT.

Source: MDEV-3926, Comment by Sergei Golubchik

See also

  • MDEV-3926, MDEV-5007, MDEV-3795.

  • SELECT

  • ORDER BY

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

General Questions

Frequently Asked Questions for MariaDB that also apply to MySQL

Does the Password Prompt Appear Before or After Establishing a Connection?

Question: When I use the mysql client as in mysql -u root -p -h <host>, does the password-enter prompt popup before or after the client has established a connection with the server?

Answer: Before the client has established a connection to the server.

How do we derive the answer?

lovegood:~ byte$ mysql -uroot -p -hlocalhost
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.2.8-MariaDB Source distribution

This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> \q
Bye
lovegood:~ byte$ mysql.server stop
Shutting down MySQL
. SUCCESS! 
lovegood:~ byte$ mysql -uroot -p -hlocalhost
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

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

What is the Goal of MariaDB?

To provide a community developed, stable, and always Free DBMS that is, on the user level, broadly compatible with MySQL.

We strive for interoperability with both our own, and our upstream, communities.

Until MariaDB 5.5, MariaDB was kept up to date with the latest MySQL release from the same branch. For example MariaDB 5.1.47 was up to date with MySQL 5.1.47, and so on.

We did a merge from the main MySQL branch for every new MySQL release or when there was some critical bugfix applied to the main branch.

Since MariaDB 10.0, MariaDB includes backported features from MySQL as well as entirely new features not found anywhere else, but does not necessarily include all MySQL features.

We strive to keep our main trees as free from bugs as possible. It should be reasonably safe to pull from our trees at any time.

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

Why is the Software Called MariaDB?

The 'MySQL' name is trademarked by Oracle, and they have chosen to keep that trademark to themselves. The name MySQL (just like the MyISAM storage engine) comes from Monty's first daughter My. The first part of 'MySQL' is pronounced like the English adjective, even if this doesn't match the correct pronunciation of the Finnish name.

MariaDB continues this tradition by being named after his younger daughter, Maria.

The name Maria was initially given to a storage engine. After MariaDB was started, to avoid confusion, it was renamed to Aria. The new name was decided as a result of a contest.

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

High Availability Questions

Licensing Questions

Here you can find answer to questions about licensing MariaDB/MySQL/plugins etc

Licensing FAQ

In this article we will explain how the MariaDB and MySQL server and client library licenses affect other applications and what steps you can take to comply with the GPL or avoid having to change your applications to GPL.

In the following text we talk about MariaDB. The guidelines also apply to MySQL in general, at least up to 5.1.55 which was the latest stable release at the time of writing.

Licenses used by MariaDB

MariaDB is distributed under the GPL license, version 2.

The MariaDB client libraries for C, Java and ODBC are distributed under the LGPL license, version 2.1 or later. The LGPL license allows you to distribute these MariaDB client libraries freely with any application.

The MariaDB client library included with the MariaDB server is also GPL version 2, but has a FLOSS exception that allows you to combine it with most other open source software, without conflicting with their license, even if that license is incompatible with the GPL. We do however recommend you to use the new client libraries for any non-GPL application.

Internal usage is free

The GPL license only affects code that you distribute to other parties.

Internal usage within an organization is totally free and not subject to any conditions. There is no such thing as 'internal distribution' that would restrict the usage of your code by requiring it to be GPLed.

Connecting to a remote service that runs MariaDB (or any other GPL software) in the background is also free.

For internal programs for which you own all the copyright(s), there is essentially no risk in using GPL software. The argument you can use in your defense is that if the software became GPL as part of the distribution, you as the copyright holder could immediately revert your part back to its original copyright. No one has the right to require you to reveal or redistribute your code to the outside of your organization even if you would have distributed it internally linked with GPL software!

If your lawyers are concerned about distributions of software linked with GPL libraries between different legal entities within your organization, you can solve this by distributing your components and the GPL software separately, and have your other entity combining them. You can also switch to use the new LGPL client libraries.

Distributing an application with a MariaDB connector/client

This section is for those that want to distribute the MariaDB client library code, but not the server, with their applications.

Free software/open source applications

If your application is Free software/open source and uses one of the licenses listed in theFLOSS exception, the GPL in the client library does not affect your application.

In other cases we recommend you to use the new LGPL client libraries.

Using a connector that is not GPL

If you are using a connector that is not GPL, you are only bound by the license of that connector. Some examples are:

  • MySQL native driver for PHP - mysqlnd

  • ruby-mysql

  • LGPL client libraries or C, Java and ODBC.

The above have licenses that allow you to use them freely, without you being bound by the GPL.

Using a database source independent framework

If you are using a framework that allows you to connect dynamically to different RDBMS systems, any GPL licensed module loaded by the framework will not affect the application. Such frameworks are

  • ODBC (Open Database Connectivity)

  • JDBC (Java Database connectivity)

  • Perl

  • PHP PDO MySQL driver

The reason the GPL in the MySQL client library would not affect your application in this case is that the GPL client is supporting a standard interface and is thus merely an optional component among many. Your application could just as easily use the framework to connect to a RDBMS other than MariaDB or MySQL.

Any software can be connected to the GPL v2 licensed MySQL Connector/ODBC, without the need for that software to be GPLed. This is because there is a piece of general management software, the ODBC manager, between the GPLed MySQL Connector/ODBC and your software. If any logic would require the software which interfaces with MySQL Connector/ODBC to be GPL, then that would apply also to the ODBC manager itself. Yet, the ODBC manager is not GPL, neither on Windows nor on Linux. By consequence, no one would be allowed to use MySQL ODBC driver for anything.

Using the MariaDB client library for C

If your application is using a license that is not covered by theFLOSS exception, then you should use the new LGPL client libraries or C.

The LGPL license allows you to distribute these MariaDB client library freely with any application. If you modify the client library, you need to publish the new source code.

Distributing a proprietary application with the MariaDB / MySQL server

When you are distributing your application together with MariaDB or MySQL you are bound (or can be seen to be bound by some lawyers) by the GPL if some of the following statements apply:

  • You are using GPL code from MySQL linked directly to your application. (Like the MySQL GPL client library).

  • Your application requires the MariaDB server to work and without the MariaDB server it doesn't start or it has very limited functionality.

The problem with the client library can be avoided by using one of the solutions mentionedearlier.

If your application works with many databases, either natively or by using one of thedatabase source independent frameworks, then you can freely distribute the MariaDB server with your application without being affected by the GPL. The reason for this is that MariaDB would only be an optional, independent component in your software distribution and section 2 of the GPL explicitely allows this:

"In addition, mere aggregation of another work not based on
the Program with the Program (or with a work based on the Program) on
a volume of a storage or distribution medium does not bring the other
work under the scope of this License."

You also have the option to buy licenses for MySQL from Oracle to get MySQL under other copyright terms. If you would like to later be able to use MariaDB instead of MySQL, please ensure that your license agreement allows you to make changes to the MySQL code! (This is something that you should ensure in all cases as otherwise you may run into bugs that Oracle will not fix, you are not allowed to fix and could make MySQL software unusable for you!)

The rights to use the MariaDB code changes in your application can be requested from SkySQL.

Legal notice

The text above is written by Michael "Monty" Widenius, who is not a lawyer and you should not regard any statements of the above as 'ultimate truth' in all scenarios. On the other hand, it was David and Monty who together decided to make MySQL GPL and also decided and openly declared the intentions behind this license change, so there is some merit to information in this article.

If you want a second opinion of how GPL works in this case, you can contact Software Freedom Law Center or Free Software Foundation about this. Neither part has had anything to do with this KB article but they are the default authorities to turn to when you want to know more about the GPL or LGPL.

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

MariaDB Licenses

MariaDB Software Questions

What is MariaDB?

MariaDB is a backwards compatible, drop-in replacement of the MySQL® Database Server. It includes all major open source storage engines.

You can see a list of all current and old releases as well as a feature comparison to MySQL.

The source code for MariaDB is publically available on GitHub. Binaries and packages are also available.

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

What is MariaDB's Release Policy and Schedule?

The MariaDB Development Plans page links to plans for future versions of MariaDB.

The release schedule for upcoming MariaDB releases can be found on the MariaDB Jira release page.

See also the release criteria page.

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

What will be in MariaDB version X?

You can read about the features and improvements included in the current stable release of MariaDB on theMariaDB versus MySQL page.

The MariaDB Development Plans page links to our plans for future versions of MariaDB.

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

When will MariaDB version X be released?

The downloads page has the current stable and development releases.

See the MariaDB Development Plans page for plans for future versions of MariaDB.

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

Migrating to MariaDB Questions

How can I Import Only a Table's Structure?

How do I migrate a MySQL database to Amazon RDS?

Amazon Relational Database Service (Amazon RDS) is part of the Amazon Web Services, that allows one to setup and run a relational database in the cloud. It supports running MariaDB in addition to MySQL, PostgreSQL, and other common relational databases.

Gee-Hwan Chuang of Listia has written a guide titled Moving a Production MySQL Database to Amazon RDS with Minimal Downtime. He recommends using mysqldump.

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

Red Hat 6 Process Limit a Errors

When upgrading from MySQL 5.1 to MariaDB 5.5 you may encounter a process limit problem with your MariaDB installation. This is not MariaDB at fault. The issue is likely triggered with high connection counts to the database and possibly exacerbated by not using Thread pooling.

You might encounter the following error message if you are not out of available memory:

##SQLSTATE[HY000] [1135] Can't create a new thread (errno 11);##

You can consult the manual for a possible OS-dependent bug when trying to connect. There is a very good explanation and troubleshooting with a work around on the Percona MySQL Performance Blog

Review your connections and thread consumption usage prior to doing an upgrade to avoid this being a problem.

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

Public Questions

Questions asked by the public about MariaDB and related software. Note that bugs, problems and features requests should be submitted to the MariaDB bug database so that they can be process properly by the MariaDB developer and QA teams.

Support Questions

Getting Help With MariaDB

If you can't find help in the MariaDB documentation, you can also subscribe to the mailing lists or Zulip to communicate with MariaDB users and developers.

There's an active help community on StackOverflow for programming with SQL and indexing questions, and DBA StackExchange for non-programming questions for example tuning/backups/architecture/migration/replication etc. Use the mariadb tag so questions are searchable by those that can help you.

If you have a question about a feature that is not properly documented or something that is not working as expected, go to the corresponding documentation page and ask your question there.

You can report and check on bugs which apply to MariaDB in JIRA.

MariaDB plc offers commercial support.

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

Supported Software & Features

Here you can ask questions if MariaDB supports a certain feature that doesn't fit into any specific category.

Before asking a questions about a non existing feature, please first check the JIRA if there is already plans for that feature.