Linux and macOS
Install, upgrade, and remove MariaDB Shell on Linux and macOS with the install.sh script.
The install.sh script installs MariaDB Shell into your home directory from a GitHub release. It runs under any POSIX shell, including minimal container images that have no bash.
Requirements
Linux with glibc 2.34 or later, or macOS 15 or later (macOS 26 or later on Apple silicon). Linux distributions based on musl libc are not supported.
An x86-64 or ARM64 CPU.
curl,tar, andawk.sha256sumorshasum, to verify the download.jqorpython3, only when you install a prerelease with--pre-release.
Install the Latest Release
Run the script from the repository:
curl -fsSL https://github.com/mariadb-corporation/mariadb-shell/raw/main/install.sh | bashThe script performs these steps:
Detects the operating system, the CPU architecture, and, on Linux, the glibc version (with
getconf GNU_LIBC_VERSION, orldd --versionas a fallback). On macOS, it reads the major version fromsw_vers.Downloads the
SHA256SUMSfile of the release and uses it as the list of available packages.Selects the package that matches your architecture and has the highest platform version that is not newer than yours. For example, a package built for glibc 2.34 is selected on a system with glibc 2.39.
Downloads the package and compares its SHA-256 checksum with the value in
SHA256SUMS. The script stops if the checksums don't match.Unpacks the package into
~/.local/share/mariadb-shell/<version>, for example~/.local/share/mariadb-shell/26.9.5.Creates the symbolic links
~/.local/bin/mariadb-shelland~/.local/bin/msh, which point to the installed version. If the package includesmariadb-lsp, the MariaDB SQL language server, it also creates~/.local/bin/mariadb-lsp. If it does not, the script removes amariadb-lsplink that an earlier installation created.Removes older versions, keeping the new version and one previous version. See Upgrade and Roll Back.
A successful run ends with output similar to the following:
Install a Prerelease
To install the newest release even if it is a prerelease, pass --pre-release to the script. When you pipe the script into a shell, pass options after -s --:
Install a Specific Version
To install a particular release, set MARIADB_SHELL_TAG to its tag. A pinned tag takes precedence over --pre-release:
Each release also carries a copy of install.sh as a release asset.
Add the Command Directory to PATH
The script does not edit your shell startup files. If ~/.local/bin is not on your PATH, the script prints a reminder at the end. Add the directory to your shell profile, for example ~/.bashrc or ~/.zshrc:
Open a new terminal, then check the installation:
Installation Options
The script reads the following environment variables:
MARIADB_SHELL_TAG
Newest release
Release tag to install, for example v26.9.5.
MARIADB_SHELL_PREFIX
~/.local/share/mariadb-shell
Directory that holds the unpacked versions.
MARIADB_SHELL_BINDIR
~/.local/bin
Directory where the mariadb-shell, msh and mariadb-lsp links are created.
MARIADB_SHELL_REPO
mariadb-corporation/mariadb-shell
GitHub repository, in owner/repo form, to install from. It must be public.
The script accepts these options:
--pre-release
Install the newest release, including prereleases.
-h, --help
Print usage information and exit.
For example, to install into /opt/mariadb-shell and create the links in /usr/local/bin, run the script as a user who can write to both directories:
Upgrade and Roll Back
To upgrade, run the installation command again. The script installs the new version next to the existing ones and points the mariadb-shell, msh and mariadb-lsp links at it. Running the command for a version that is already installed replaces that version's files.
After each installation, the script keeps only two versions in the prefix directory: the version it installed and the highest of the other versions. It removes only directories whose names consist of digits and dots, and leaves any other files in the prefix directory alone.
To roll back to the previous version, point the links at it:
Alternatively, reinstall the earlier release with MARIADB_SHELL_TAG.
Upgrading does not change your configuration directory, ~/.mariadb-shell.
Uninstall
The script has no uninstall mode. To remove MariaDB Shell, delete the links and the installation directory:
If you used MARIADB_SHELL_PREFIX or MARIADB_SHELL_BINDIR, delete those locations instead.
To also remove your history, settings, plugins, log file, and sandbox instances, delete ~/.mariadb-shell. Stop any running sandbox instances first. See Files and Environment Variables.
Troubleshooting
could not determine the glibc version (musl is not supported)
The system does not use glibc. Use a glibc-based distribution or container image.
no compatible package for linux 2.31 / x86-64bit
The system's glibc is older than any package in the release. The script lists the available packages. Upgrade to a distribution with glibc 2.34 or later.
unsupported CPU architecture
Only x86-64 and ARM64 packages are built.
could not download SHA256SUMS from the latest release
The release does not exist or is a prerelease. Use --pre-release or set MARIADB_SHELL_TAG.
checksum mismatch
The download is corrupt or incomplete. Run the script again.
this install needs jq or python3 to read the release listing
Install jq or python3, which the script needs for --pre-release.
This page is licensed: GPLv2
Last updated
Was this helpful?

