Mysql-ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)

一、登录mysql,ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)解决办法

实际是登录MYSQL密码错误,找到正确的登录密码即可。

如果记不起来密码,重置密码参考文章:https://blog.csdn.net/m0_46278037/article/details/113923726

 

二、MySQL5.7执行mysqld命令出现Can‘t change dir to ‘C:\Program Files\MySQL\MySQL Server 5.7\data\‘错误

提示No such file or directory,到C:\Program Files\MySQL\MySQL Server 5.7\目录下创建data文件夹即可。

参考文章:https://blog.csdn.net/zhangjm123/article/details/107378659/

 

三、修改密码报错,ERROR 1054(42S22) Unknown column 'password' in ‘field list’

本意向修改一个用户的密码,网上搜到的命令为如下:

mysql> update user set password=password(‘123') where user='root' and host='localhost';

执行后报错  ERROR 1054(42S22) Unknown column 'password' in ‘field list’

错误的原因是 5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string

所以请使用一下命令:

mysql> use mysql;

mysql> update user set authentication_string=password(‘123') where user='root' and host='localhost';
mysql> flush privileges;

posted on 2022-01-03 23:19  cherry_ning  阅读(500)  评论(0)    收藏  举报

导航