def user_remove(name, database=None, user=None, password=None, host=None, port=None):
 if (not user_exists(name, database, user, password, host, port)):
  if database:
   log.info("User '{0}' does not exist for DB '{1}'".format(name, database))
  else:
   log.info("Cluster admin '{0}' does not exist".format(name))
  return False
 client = _client(user=user, password=password, host=host, port=port)
 if (not database):
  return client.delete_cluster_admin(name)
 client.switch_database(database)
 return client.delete_database_user(name)

def user_remove ( name , database = None , user = None , password = None , host = None , port = None ) : if ( not user_exists ( name , database , user , password , host , port ) ) : if database : log . info ( "User '{0}' does not exist for DB '{1}'" . format ( name , database ) ) else : log . info ( "Cluster admin '{0}' does not exist" . format ( name ) ) return False client = _client ( user = user , password = password , host = host , port = port ) if ( not database ) : return client . delete_cluster_admin ( name ) client . switch_database ( database ) return client . delete_database_user ( name )
delete mysql user cli example: .