不知道用户密码,并且不改变用户密码的情况下,批量刷新MySQL数据库用户的密码
select concat(\'alter user \\'\',user,\'\\'@\\'\',host,\'\\' identified by \\'\',authentication_string,\'\\';\') as change_password from mysql.user;
扩展:
在其他MySQL实例创建与本实例密码相同的用户
select concat(\'create user \\'\',user,\'\\'@\\'\',host,\'\\' identified by password \\'\',authentication_string,\'\\';\') as create_user from mysql.user;