小记几个关于Linux环境使用mysql遇到的问题:
1、使用如下密令更新密码报错:ERROR 1054(42S22) Unknown column 'password' in ‘field list’
mysql> update user set password=password(“新密码”) where user=”用户名”;
原因是5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string;改为:
update mysql.user set authentication_string=password('******') where user='****';
2、修改完密码后登陆提示:ERROR 1045 (28000): Access denied for user '****'@'localhost' (using password: YES)
网上看到很多复杂的方法,其实有几个简单方法:赋权即可:grant all privileges on *.* to 用户名@'%' 或者flush privileges;