• [数据库]mysql MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)


    [数据库]mysql配置连接拒绝无权限解决方法

    https://www.cnblogs.com/bjlhx/p/11395992.html

    1、新安装的mysql报错

    MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)

    解决方案

    1、先停掉原来的服务

    /etc/init.d/mysqld stop

    2、使用安全模式登陆,跳过密码验证

    mysqld_safe --user=mysql --skip-grant-tables --skip-networking&

    或者上述两步可以使用如下操作

      在mysql的配置文件内加入:

      vim  /etc/my.cnf

      skip-grant-tables

      保存并重启mysql服务

    3、进入mysql,修改密码:

    mysql> use mysql;

    mysql> update user set password=password("你的新密码") where user="root";

    mysql> flush privileges;

    mysql> quit

    到此root账户就重置了密码,

      注意:如果使用配置文件了,需要删除etc/my.cnf中,刚添加的那行内容,重启mysql就好了

    更新密码出错

      mysql> update user set password=password("你的新密码") where user="root";

      报错:ERROR 1054 (42S22): Unknown column 'password' in 'field list'

      解决措施如下:

      mysql>desc user;

      发现在Field列中没有password,此时我们需要这样重置密码:

      mysql>update user set authentication_string=password('123456') where user='root';

  • 相关阅读:
    组合博弈入门
    模拟练1
    鼠标点击 input,显示瞬间的边框颜色,对之修改与隐藏
    display: inline-block兼容性写法
    background-clip与background-origin两者的区别
    article标签和aside标签两者的理解
    jQuery插件实现左右无缝轮播
    JS面向对象基础2
    JS面向对象基础1
    CSS3的基础知识点
  • 原文地址:https://www.cnblogs.com/tiaotiaoxia/p/11398564.html
Copyright © 2020-2023  润新知