在数据库命令行里,输入:
mysql> set password for root@localhost = password('123');
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 'password('123')' at line 1
提示,让我看看语法,可看过来看过去,也没输错啊!
网上查询得知,有可能是,我这数据库版本有点新,有些许改变
尝试:
alter user 'root'@'localhost' identified by '123';
Query OK, 0 rows affected (0.33 sec)
成功!!!