zoukankan      html  css  js  c++  java
  • ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

    solution 1:
    1.关闭mysql
       # service mysqld stop
    2.屏蔽权限
       # mysqld_safe --skip-grant-tables 
    3.新开起一个终端输入
       # mysql -u root mysql
       mysql>update mysql.user set authentication_string=password('123456') where user='root';
       mysql> FLUSH PRIVILEGES;//记得要这句话,否则如果关闭先前的终端,又会出现原来的错误
       mysql>exit;

    solution2:
    1.关闭mysql
       # service mysqld stop
    2.屏蔽权限
       # mysqld_safe --skip-grant-tables 
    3.新开起一个终端输入
       # mysql -u root mysql
       mysql> delete from user where USER='';
       mysql> FLUSH PRIVILEGES;//记得要这句话,否则如果关闭先前的终端,又会出现原来的错误
       mysql> exit;

    修改密码过程中,遇到如图所示的情况:

    查看日志:

    解决办法:

    sudo service mysql status
    sudo service mysql stop

     If you have issue stopping then do following

     Search for process: 

    ps aux | grep mysqld

    Kill the process:

     kill -9 process_id

    Now start mysql in safe mode with skip grant

    sudo mysqld_safe --skip-grant-tables 

     排除遇到的问题外,继续执行solution1或者solution2

  • 相关阅读:
    Android ArrayAdapter使用
    Android 更改字体
    C# CRC16校验码 1.0
    获取当前主题颜色 Flutter
    C# 每个字节接受 处理串口数据 的方法
    C# CRC
    char* 与 string 互转
    typeof 子类获取父类
    flutter Row 垂直或水平放置多个widget
    flutter 容器 几种写法
  • 原文地址:https://www.cnblogs.com/peteremperor/p/9311878.html
Copyright © 2011-2022 走看看