One CLI to Rule Them All: New MariaDB Shell
Over the years, many contributors in the MariaDB and MySQL communities sought to solve common operational and usability issues. Companies like Yahoo, Google, Facebook and Github all created their own suites of command line tools. Many of these tools became well known and trusted within the industry by DBAs and developers alike.
Some of the most critical tools make it easier to administer and replicate your database or provide entire HA and business continuity solutions. However, some MariaDB client tools (e.g. mariadb cli, mariadb-admin, mariadb-chk) are at risk of becoming stale and have room for improvement.
Various teams within MariaDB plc came together to find the best of these tools and begin creating a more modern interface for our modern product suite, including MariaDB Community Server, MariaDB Enterprise Server, MariaDB Xpand, and MariaDB MaxScale. Our goal was to provide a friendlier interface along with easier troubleshooting and administration. The new MariaDB Shell should be familiar and mostly flag compatible, but better and more intuitive than the old command line interface (CLI).
MariaDB Shell Walkthrough
When you log into MariaDB Shell for the first time, you instantly see a difference. No more black and white terminal with cryptic error messages.
Shell output has a cleaner look. But for those users who miss the old look, the output
command allows customization.
The output feature has a number of other features, such as JSON output. Read more here: https://mariadb.com/docs/server/ref/msh/cli/mariadb-shell/output/
The classic commands like pager
and \G
are still available, with \G
gaining more useful functions, such as pretty printing json, depending on your output
format.
Many of the commands users are familiar with from mariadb-admin (previously mysqladmin) are available in MariaDB Shell using the sys
command.
For example, mariadb-admin status
can be called from the command line or within MariaDB Shell:
New Features
The first version of MariaDB Shell has some great new features, such as the ability to warm in memory storage engine caches such as the InnoDB buffer pool.
Warming a single table
Warming a database
The connection library allows users to store and retrieve profiles, similar to other cloud shells such as aws
and gcloud
. The profiles command can be combined with connect
and disconnect
so that the connection string is not always required to switch between databases.
Many users coming from legacy RDBMS miss features that allow profiling the system and exporting reports that can be shared within a company. The mariadb-shell fish
feature collects environment and performance data to create a report that can later be used to track database trends.
In addition, when troubleshooting issues, the tail
command allows reading of all logs and server status at once.
Other features include launching the MaxScale SQL IDE locally and installing the Remote Observability Service agent to monitor databases.
Conclusion
We plan to make MariaDB Shell the centerpiece of the MariaDB command line tools by adding more features in the near future. It is currently available for download for all users from mariadb.com/downloads/tools/shell. Our goal is to make MariaDB Shell the indispensable go-to tool for open source databases everywhere.