ERROR 1045 (28000)——mysql

    科技2022-07-11  97

    使用mysqladmin命令修改密码失败,再次登录时提示ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password)。拒绝root用户访问

    个人认为这是,在命令行中直接修改密码时触发的msyql保护机制。

    以下是跳过认证直接进入mysql的方式:

    --关闭mysql服务 net stop mysql --启动mysql(登录时跳过认证) mysqld --console --skip-grant-tables --shared-memory

    另起一个窗口,输入mysql可以直接进入。

    下面是msyql8.0.19.0密码修改

    https://mp.csdn.net/console/editor/html/108912384

    如果手机8.0之前的版本,进入mysql后使用以前的方式修改

    mysql>UPDATE user SET authentication_string=password('123123') WHERE user='root'; mysql>flush privileges; 

     

    Processed: 0.009, SQL: 8