最近搞公司的OA系统--->翻新数据库--->修改用户名密码,两个修改都出现问题:
修改用户名:
mysql> update user set user=uesr('oaUser') where user='oauser';
ERROR 1062 (23000):Duplicate entry 'localhost-root' for key 'PRIMARY'
修改密码:
mysql> update user set password=password('123456') where user='oaUser1';
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
解决:用户名是因为数据库中已经有一个相同名字了,修改即可;
Window下MySQL密码列是authentication_string,所以正确的写法是:
mysql> update user set authentication_string=password('123456') where user='oaUser1';