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

  • 相关阅读:
    漫谈 IP 协议
    Git常用组合操作
    my questions of C#
    关于C#多态的思考
    设计模式:示例与思考
    C#环境搭建,以及C#编译器的使用
    网络模型和TCP协议族
    Understanding TCP/IP Network Stack
    Get on the CORBA
    Introduction to COBRA
  • 原文地址:https://www.cnblogs.com/peteremperor/p/9311878.html
Copyright © 2011-2022 走看看