diff --git a/mysql/utilities/common/user.py b/mysql/utilities/common/user.py index 515f5e2e..0cbddd78 100755 --- a/mysql/utilities/common/user.py +++ b/mysql/utilities/common/user.py @@ -680,16 +680,7 @@ def clone(self, new_user, destination=None, globals_privs=False): grant = row[0].replace(base_user_ticks, new_user_ticks, 1) # Need to remove the IDENTIFIED BY clause for the base user. - search_str = "IDENTIFIED BY PASSWORD" - try: - start = grant.index(search_str) - except: - start = 0 - - if start > 0: - end = grant.index("'", start + len(search_str) + 2) + 2 - grant = grant[0:start] + grant[end:] - + grant = re.sub(r"IDENTIFIED\sBY\sPASSWORD(?:(?:\s)|(?:\s\'[^\']+\')?)",'',grant) if self.verbosity > 0: print grant