且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

错误1064(42000):您的SQL语法有错误;想要将密码配置为root用户

更新时间: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';

致谢