更新时间:2022-01-18 21:23:24
您可以使用:
SET PASSWORD FOR 'root' = PASSWORD('elephant7');
或者,最新版本:
SET PASSWORD FOR root = 'elephant7'
您还可以使用:
UPDATE user SET password=password('elephant7') WHERE user='root';
但是在Mysql 5.7中,字段密码不再存在,您必须使用:
but in Mysql 5.7 the field password is no more there, and you have to use:
UPDATE user SET authentication_string=password('elephant7') WHERE user='root';
致谢