zoukankan      html  css  js  c++  java
  • Linux连接mysql 出现Access denied for user 'root'@'localhost'(using password: YES)错误解决方案

    linux连接mysql /usr/local/mysql/bin/mysql -uroot -p

    输入密码出现Access denied for user 'root'@'localhost'(using password: YES)错误。

    解决办法:

    1.先停止mysql 服务

    service mysqld stop

    2.进入mysql安装目录bin/ 使用safe模式,进行重启:

    ./mysqld_safe --skip-grant-tables

    3.新开一个终端,使用root账户,无密码登录,修改root用户密码

    /usr/local/mysql/bin/mysql -uroot

    use mysql
    update user set password=PASSWORD("你的密码") where User = 'root';
    5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string
    update user set authentication_string=PASSWORD("你的密码") where User = 'root';

    4.重启mysql,正常登录

    service mysqld restart  重启

    /usr/local/mysql/bin/mysql -uroot -p  然后输入刚才重置的密码

    完成,连接成功!

  • 相关阅读:
    【html、CSS、javascript-9】jquery-选择器及过滤器
    【python之路40】Python 作用域
    H5缓存
    解决网络不可用--Using_Service_Workers
    跨域请求CORS
    基于node的websocket示例
    test
    函数节流
    ES6 promise
    web前端免费资源集
  • 原文地址:https://www.cnblogs.com/boris-et/p/8316953.html
Copyright © 2011-2022 走看看