fix(cli): Use mysql CLI as fallback is mariadb isnt found (#23006)

This commit is contained in:
gavin 2023-10-30 16:39:36 +01:00 committed by GitHub
parent bedef22f34
commit 9b112b3e03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -726,7 +726,7 @@ def _guess_mariadb_version() -> tuple[int] | None:
# in non-interactive mode.
# Use db.sql("select version()") instead if connection is available.
with suppress(Exception):
mariadb = which("mariadb")
mariadb = which("mariadb") or which("mysql")
version_output = subprocess.getoutput(f"{mariadb} --version")
version_regex = r"(?P<version>\d+\.\d+\.\d+)-MariaDB"