code: def get_mysql_vars(mysql: str,
                     host: str,
                     port: int,
                     user: str) -> Dict[str, str]:
      
      cmdargs = [
          mysql,
          "-h", host,
          "-P", str(port),
          "-e", "SHOW VARIABLES; SHOW STATUS",
          "-u", user,
          "-p"  # prompt for password
      ]
      log.info("Connecting to MySQL with user: {}", user)
      log.debug(cmdargs)
      process = subprocess.Popen(cmdargs, stdout=subprocess.PIPE)
      out, err = process.communicate()
      lines = out.decode("utf8").splitlines()
      mysqlvars = {}
      for line in lines:
          var, val = line.split("\t")
          mysqlvars[var] = val
      return mysqlvars
docs: Asks MySQL for its variables and status.
  
      Args:
          mysql: ``mysql`` executable filename
          host: host name
          port: TCP/IP port number
          user: username
  
      Returns:
          dictionary of MySQL variables/values