Windows
Install, upgrade, and remove MariaDB Shell on Windows with the install.ps1 PowerShell script.
The install.ps1 script installs MariaDB Shell for the current user from a GitHub release. It runs in Windows PowerShell 5.1 and in PowerShell 7, and does not require administrator privileges.
Requirements
64-bit Windows on an x86-64 or ARM64 CPU. 32-bit Windows is not supported.
Windows 10 version 1803 or later, which includes the
tarcommand that the script uses to unpack the package.
Install the Latest Release
Run the following command in a PowerShell window:
irm https://github.com/mariadb-corporation/mariadb-shell/raw/main/install.ps1 | iexThe script performs these steps:
Detects the CPU architecture of the machine, not of the PowerShell process. A 32-bit PowerShell on 64-bit Windows, or an x64 PowerShell that runs emulated on ARM64 Windows, still gets the package for the machine.
Downloads the
SHA256SUMSfile of the release and uses it as the list of available packages.Selects the Windows package for your architecture.
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
%LOCALAPPDATA%\Programs\mariadb-shell\<version>, for example%LOCALAPPDATA%\Programs\mariadb-shell\26.9.5.Writes two command files,
mariadb-shell.cmdandmsh.cmd, into%LOCALAPPDATA%\Programs\mariadb-shell\bin. Both start the installed version'smariadb-shell.exe. When the command directory is thebindirectory of the installation directory, as it is by default, they use paths relative to their own location, so you can move the whole installation directory. A command directory elsewhere, set with-BinDirorMARIADB_SHELL_BINDIR, gets command files with absolute paths. Such a path starts with%LOCALAPPDATA%or%USERPROFILE%when the installation directory is below one of them, so a user name with non-ASCII characters works. Any other part of the path must be plain ASCII, or the script stops before it downloads anything. If the package includesmariadb-lsp.exe, the MariaDB SQL language server, the script also writesmariadb-lsp.cmd, which starts it. If it does not, the script removes amariadb-lsp.cmdthat an earlier installation wrote.Removes older versions, keeping the new version and one previous version. See Upgrade and Roll Back.
Pass Options to the Script
When you pipe the script into iex, you cannot pass parameters to it. Each parameter therefore has an equivalent environment variable, which you set before you run the command. For example, to install the newest release and add the command directory to your PATH:
To pass parameters directly, create a script block from the downloaded script and invoke it:
Install a Prerelease
To install the newest release even if it is a prerelease, set MARIADB_SHELL_PRERELEASE, or use the -PreRelease parameter:
Install a Specific Version
To install a particular release, set MARIADB_SHELL_TAG to its tag, or use the -Tag parameter. A pinned tag takes precedence over -PreRelease:
Environment variables that you set with $env: remain set for the rest of the PowerShell session. Remove them with Remove-Item Env:MARIADB_SHELL_TAG before you install another version in the same window.
Add the Command Directory to PATH
The script changes your user PATH only when you ask it to with -AddToPath or MARIADB_SHELL_ADDTOPATH. Otherwise, it prints the command to add the directory yourself:
Open a new terminal so that the change takes effect, then check the installation:
Installation Options
-Tag
MARIADB_SHELL_TAG
Newest release
Release tag to install, for example v26.9.5.
-PreRelease
MARIADB_SHELL_PRERELEASE
Off
Install the newest release, including prereleases.
-AddToPath
MARIADB_SHELL_ADDTOPATH
Off
Add the command directory to the user PATH.
-Prefix
MARIADB_SHELL_PREFIX
%LOCALAPPDATA%\Programs\mariadb-shell
Directory that holds the unpacked versions.
-BinDir
MARIADB_SHELL_BINDIR
<prefix>\bin
Directory where mariadb-shell.cmd, msh.cmd and mariadb-lsp.cmd are written.
-Repo
MARIADB_SHELL_REPO
mariadb-corporation/mariadb-shell
GitHub repository, in owner/repo form, to install from. It must be public.
A parameter takes precedence over its environment variable. For the switch variables MARIADB_SHELL_PRERELEASE and MARIADB_SHELL_ADDTOPATH, any non-empty value turns the setting on.
Upgrade and Roll Back
To upgrade, run the installation command again. The script installs the new version next to the existing ones and rewrites mariadb-shell.cmd, msh.cmd and mariadb-lsp.cmd to start it.
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.
To roll back, reinstall the earlier release with MARIADB_SHELL_TAG. Alternatively, edit the .cmd files and change the version in the path they start.
Upgrading does not change your configuration directory, %AppData%\MariaDB\mariadb-shell.
Uninstall
The script has no uninstall mode. To remove MariaDB Shell:
Delete the installation directory:
If you added the command directory to your user
PATH, remove that entry, for example in Settings > System > About > Advanced system settings > Environment Variables.Optionally, delete your configuration directory,
%AppData%\MariaDB\mariadb-shell, and your sandbox directory,%USERPROFILE%\MariaDB\mariadb-shell\sandboxes. Stop any running sandbox instances first. See Files and Environment Variables.
Troubleshooting
tar was not found
Your Windows build is older than Windows 10 version 1803. Install manually as described in Manual Installation, using another tool to unpack the package.
32-bit Windows is not supported
Only 64-bit packages are built.
could not download SHA256SUMS from the latest release
The release does not exist or is a prerelease. Set MARIADB_SHELL_PRERELEASE or MARIADB_SHELL_TAG.
checksum mismatch
The download is corrupt or incomplete. Run the script again.
LOCALAPPDATA is not set
The default installation directory cannot be determined. Set MARIADB_SHELL_PREFIX or pass -Prefix.
This page is licensed: GPLv2
Last updated
Was this helpful?

