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:
-
- mariadb → mysql
- mariadb-access → mysqlaccess
- mariadb-admin → mysqladmin
- mariadb-binlog → mysqlbinlog
- mariadb-check → mysqlcheck
- mariadb-convert-table-format → mysql_convert_table_format
- mariadbd-multi → mysqld_multi
- mariadbd-safe → mysqld_safe
- mariadbd-safe-helper → mysqld_safe_helper
- mariadb-dump → mysqldump
- mariadb-dumpslow → mysqldumpslow
- mariadb-embedded → mysql_embedded
- mariadb-find-rows → mysql_find_rows
- mariadb-fix-extensions → mysql_fix_extensions
- mariadb-hotcopy → mysqlhotcopy
- mariadb-import → mysqlimport
- mariadb-install-db → mysql_install_db
- mariadb-plugin → mysql_plugin
- mariadb-secure-installation → mysql_secure_installation
- mariadb-setpermission → mysql_setpermission
- mariadb-show → mysqlshow
- mariadb-slap → mysqlslap
- mariadb-tzinfo-to-sql → mysql_tzinfo_to_sql
- mariadb-upgrade → mysql_upgrade
- 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