MariaDB Named Commands

This year it will be 10 years since the first version of MariaDB Server was published. The first release was version 5.1.38, which happened in the fall of 2009. Since then, MariaDB Server has added new capabilities at a fast pace and is now seen as a distinct database in its own right.

With an increasing amount of differences with MySQL, we wanted to also start to prepare for MariaDB having its own commands. By taking this path it will in the future be possible to run MariaDB and MySQL, side-by-side without conflicts. Scripts and tools would use the commands with the name of the database server that is targeted and would know what features and functionality is available.

With the GA release of MariaDB Server 10.4, MariaDB named commands have been added. When you install or update to MariaDB Server 10.4.6 or later, you can start the MariaDB client by typing mariadb, instead of mysql:

rasmus@centos-7 ~$ mariadb -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 22
Server version: 10.4.6-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 [(none)]>

To get an idea of the MariaDB named commands that can be used now, here is the complete list for which we created MariaDB versions of the commands:

    1. mariadb →  mysql
    2. mariadb-access → mysqlaccess
    3. mariadb-admin → mysqladmin
    4. mariadb-binlog → mysqlbinlog
    5. mariadb-check → mysqlcheck
    6. mariadb-convert-table-format → mysql_convert_table_format
    7. mariadbd-multi → mysqld_multi
    8. mariadbd-safe → mysqld_safe
    9. mariadbd-safe-helper → mysqld_safe_helper
    10. mariadb-dump → mysqldump
    11. mariadb-dumpslow → mysqldumpslow
    12. mariadb-embedded → mysql_embedded
    13. mariadb-find-rows → mysql_find_rows
    14. mariadb-fix-extensions → mysql_fix_extensions
    15. mariadb-hotcopy → mysqlhotcopy
    16. mariadb-import → mysqlimport
    17. mariadb-install-db → mysql_install_db
    18. mariadb-plugin → mysql_plugin
    19. mariadb-secure-installation → mysql_secure_installation
    20. mariadb-setpermission → mysql_setpermission
    21. mariadb-show → mysqlshow
    22. mariadb-slap → mysqlslap
    23. mariadb-tzinfo-to-sql → mysql_tzinfo_to_sql
    24. mariadb-upgrade → mysql_upgrade
    25. mariadb-waitpid → mysql_waitpid

As seen in the list of commands they all start with mariadb-, with the exception of the client mariadb itself and the three daemon/service ones, which have a trailing d to indicate that. A nice benefit of the common naming scheme is that you can write mariadb- and press tab to get a list of all matching commands:

rasmus@centos7 ~$ mariadb-
mariadb-access             mariadb-find-rows          mariadb-setpermission
mariadb-admin              mariadb-fix-extensions     mariadb-show
mariadb-binlog             mariadb-hotcopy            mariadb-slap
mariadb-check              mariadb-import             mariadb-tzinfo-to-sql
mariadb-convert-table-format  mariadb-install-db  mariadb-upgrade
mariadb-dump               mariadb-plugin             mariadb-waitpid
mariadb-dumpslow           mariadb-secure-installation
mariadb-embedded           mariadb-service-convert

The technical implementation of the commands is done with symlinks currently, but this is only the first step. In the future the plan is that the executables and symlinks change roles. The executable will get the MariaDB name and the corresponding MySQL command will be available as a symlink.

In case you have automated a lot in your environment by calling mysql named commands, that will still work. The mysql named commands works as before.

Download MariaDB Server 10.4 today

Download