def METHOD_NAME(filename: str):
    """
    restore the mysql dump of a former linotp tools backup
    @param file: backup file name - absolute filename
    """
    app = current_app
    backup_filename = os.path.abspath(filename.strip())
    if not os.path.isfile(backup_filename):
        app.echo(f"MySQL backup file {filename!r} cannot be accessed.", v=1)
        raise click.Abort()
    # ---------------------------------------------------------------------- --
    # setup db engine, session and meta from sql uri
    sql_uri = app.config.get("DATABASE_URI")
    engine = create_engine(sql_uri)
    if "mysql" not in engine.url.drivername:
        app.echo(
            "MySQL backup file can only be restored to a "
            "MySQL database. Current database driver "
            f"is {engine.url.drivername!r}"
        )
        raise click.Abort()
    # ---------------------------------------------------------------------- --
    # determine the mysql command parameters
    command = [
        "mysql",
        f"--user={engine.url.username}",
        f"--password={engine.url.password_original}",
        f"--host={engine.url.host}",
        f"--port={engine.url.port or 3306}",
        "-D",
        engine.url.database,
    ]
    # ---------------------------------------------------------------------- --
    # run the restore in subprocess
    msg = ""
    app.echo(f"Restoring MySQL backup {backup_filename!r}", v=1)
    with open(backup_filename, "r") as backup_file:
        result = subprocess.run(
            command, stdin=backup_file, capture_output=True
        )
        if result.returncode != 0:
            app.echo(
                "Failed to restore MySQL backup file: "
                f"{result.stderr.decode('utf-8')!s}"
            )
            raise click.Abort()
        msg = result.stdout.decode("utf-8")
    app.echo(f"MySQL backup file restored: {msg!s}", v=1)