def get_mysqldump_args_and_env_from_url(url):
args = [<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>url.hostname,<EOL>]<EOL>env = {}<EOL>if url.port is not None:<EOL><INDENT>args.extend(("<STR_LIT>", six.text_type(url.port)))<EOL><DEDENT>if url.username:<EOL><INDENT>args.extend(("<STR_LIT>", url.username))<EOL><DEDENT>if url.password:<EOL><INDENT>env["<STR_LIT>"] = url.password<EOL><DEDENT>if len(url.path) < <NUM_LIT:2> or not url.path.startswith("<STR_LIT:/>"):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>args.append(url.path[<NUM_LIT:1>:])<EOL>return args, env<EOL>
Constructs list of command line arguments and dictionary of environment
variables that can be given to `mysqldump` executable to obtain database
dump of the database described in given URL.

:param url: Parsed database URL.
:type url: urllib.urlparse.ParseResult

:return: List of command line arguments as well as dictionary of
         environment variables that can be used to launch the MySQL dump
         process to obtain dump of the database.
:rtype: tuple[list[str],dict[str,str]]