zoukankan      html  css  js  c++  java
  • MySQL使用root用户授权出现错误ERROR 1045 (28000) at line 2: Access denied for user 'root'@'%' (using password: YES)解决办法

      参考:https://blog.csdn.net/open_data/article/details/42873827

      使用MySQL的root用户登录出现错误提示

      ERROR 1045 (28000) at line 2: Access denied for user 'root'@'%' (using password: YES)

      查看授权表信息,会发现grant权限后面是‘N’

    select * from mysql.userG

      但是本地登录的root用户有权限

      解决办法家socket使用localhost登录即可正常授权

    mysql -uroot -p -hlocalhost --socket=/tmp/mysql3306.sock
    

      查找本地socket的命令

    ps -ef|grep 3306|grep "socket"|awk -vRS="--socket" '{t=$0;}END{print "--socket"t}'|awk '{print $1}'
    

      也可以把root@'%'用户重新授权

    grant all on *.* to root@'%' identified by 'test123456' with grant option;
    

      

  • 相关阅读:
    npm改为淘宝镜像
    html中table中td内容换行
    git 切换文件夹路径
    git经常使用的命令
    day16
    day15
    day13
    day14
    day12
    day11
  • 原文地址:https://www.cnblogs.com/minseo/p/10291254.html
Copyright © 2011-2022 走看看