zoukankan      html  css  js  c++  java
  • [数据库]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';

  • 相关阅读:
    700. Search in a Binary Search Tree
    100. Same Tree
    543. Diameter of Binary Tree
    257. Binary Tree Paths
    572. Subtree of Another Tree
    226. Invert Binary Tree
    104. Maximum Depth of Binary Tree
    1、解决sublime打开文档,出现中文乱码问题
    移植seetafaceengine-master、opencv到ARM板
    ubuntu16.04-交叉编译-SeetaFaceEngine-master
  • 原文地址:https://www.cnblogs.com/tiaotiaoxia/p/11398564.html
Copyright © 2011-2022 走看看