mysql下载后的初次使用mysql8后正确修改初始密码⽅法
mysql5.7.9之后,就没有了password函数,所以,使⽤传统的password()函数修改root密码的话,就会提⽰sql错误
UPDATE user SET authentication_string = password('123456')WHERE User='root';
ERROR 1064(42000): You have an error in your SQL syntax;check the manual that corresponds to your MySQL server version for the right syntax to use near '('123456') WHERE User='root'' at line 1
正确设置密码的⽅法是:
ALTER USER'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。