今日,开发反馈某台mysql服务器无法登陆,解决之后,远程登录后发现用户只能看到information_schema,其他均看不到。

故登录服务器执行:

mysql> grant all on *.* to root@'%';

报了ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

查看user_privileges看见权限都是有的,如下:

mysql> select * from user_privileges;
+--------------------+---------------+-------------------------+--------------+
| GRANTEE | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE |
+--------------------+---------------+-------------------------+--------------+
| 'root'@'localhost' | def | SELECT | YES |
| 'root'@'localhost' | def | INSERT | YES |
| 'root'@'localhost' | def | UPDATE | YES |
| 'root'@'localhost' | def | DELETE | YES |
| 'root'@'localhost' | def | CREATE | YES |
| 'root'@'localhost' | def | DROP | YES |
| 'root'@'localhost' | def | RELOAD | YES |
| 'root'@'localhost' | def | SHUTDOWN | YES |
| 'root'@'localhost' | def | PROCESS | YES |
| 'root'@'localhost' | def | FILE | YES |
| 'root'@'localhost' | def | REFERENCES | YES |
| 'root'@'localhost' | def | INDEX | YES |
| 'root'@'localhost' | def | ALTER | YES |
| 'root'@'localhost' | def | SHOW DATABASES | YES |
| 'root'@'localhost' | def | SUPER | YES |
| 'root'@'localhost' | def | CREATE TEMPORARY TABLES | YES |
| 'root'@'localhost' | def | LOCK TABLES | YES |
| 'root'@'localhost' | def | EXECUTE | YES |
| 'root'@'localhost' | def | REPLICATION SLAVE | YES |
| 'root'@'localhost' | def | REPLICATION CLIENT | YES |
| 'root'@'localhost' | def | CREATE VIEW | YES |
| 'root'@'localhost' | def | SHOW VIEW | YES |
| 'root'@'localhost' | def | CREATE ROUTINE | YES |
| 'root'@'localhost' | def | ALTER ROUTINE | YES |
| 'root'@'localhost' | def | CREATE USER | YES |

so。。。。。

mysql> grant super on *.* to root@'%';
Query OK, 0 rows affected (0.02 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> grant show databases on *.* to root@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

grant 单独的权限都是有的,grant all无论是*.*还是db.*都报上述错误。。。

难不成密码未生效???

mysql> update user set password=password('XXX') where host='%';
Query OK, 2 rows affected (0.02 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

重新登录客户端,果然这问题导致。。。可问题是客户端一直都可以登录,只是无法看到其他db。。。哎,又被坑了。。。

mysql grant all on *.* to xxx@'%' 报Access denied for user 'root'@'localhost'的更多相关文章

  1. mysql 链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES))

    mysql链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)) 修改: # ...

  2. 【转载】重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor ...

  3. mac 安装mysql + 修改root用户密码 + 及报Access denied for user 'root'@'localhost' (using password:YES)解决办法

    1.下载MySQL 到mysql的官网http://dev.mysql.com/downloads/mysql/然后在页面中会看到“MySQL Community Server”下方有一个“downl ...

  4. 登录mysql 报 Access denied for user 'root'@'localhost' 错误

    安装mysql后登录提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:yes) 解决如下 ...

  5. 重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    出现报错: Warning: World-writable config file '/etc/my.cnf' is ignored // 该文件权限过高ERROR 1045 (28000): Acc ...

  6. Ubuntu下使用mysqli-connect连接mysql时报错:ERROR 1698 (28000): Access denied for user 'root'@'localhost'

    LNMP安装好后,写了个index.php文件,里面的内容很简单,就是想测试php与mysql的通信是否正常,代码如下: <?php $host = 'localhost'; $user = ' ...

  7. Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    案例环境: 操作系统 :Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64 bit 数据库版本 : Mysql 5.6.19 64 bit ...

  8. mysql 安装完毕后登陆不了mysql的 shell 即mysql&gt;遇到:ERROR 1045 (28000): Access denied for user 'root'@'localhost‘

    [root@hzswtb2-mpc ~]# mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pas ...

  9. mariadb mysql 报'Access denied for user 'root'@'localhost' (using password: NO)'错误的解决

    C:\Program Files\MariaDB 10.2\bin>mysql admin -u root password "x123456789" mysql Ver 1 ...

随机推荐

  1. Fabric自动部署太方便了

    之前不知道有Fabric工具,每次发布程序到服务器上的时候,基本流程:本地打包程序 -> Ftp上传 -> 停服务器Apache -> 覆盖文件 -> 启动Apache, 非常 ...

  2. Linq专题之var关键字

    在c#1.0,c#2.0中声明一个变量时,总是要指定变量的类型,如果不指定变量类型编译器就会报错,产生编译错误.在c#3.0中我们可以不指定变量的具体类型,而使用一个新的关键字"var&qu ...

  3. tengine + mysql + nginx + php

    tengine + mysql + nginx + php 1.配置防火墙vim /etc/sysconfig/iptables # 允许80端口通过防火墙-A INPUT -m state --st ...

  4. IOS8Preview-xCode_6

    IOS8Preview-xCode_6 what's new What's new in xCode 6 Xcode 6 introduces a radically new way to desig ...

  5. NopCommerce之事件通知

    mark下,等下写了. NewsController 控制器NewsCommentAdd()缓存清除,使用到了事件

  6. BackgroundCheck – 根据图片亮度智能切换元素样式

    BackgroundCheck 是一个轻量的 JavaScript 库,能够根据元素后面的图片的亮度自动切换元素样式.例如在图片幻灯片功能中,根据图片亮度调整导航箭头的颜色,这样让图片和导航的颜色形成 ...

  7. nodeJS 菜鸟入门

    从一个简单的 HTTP 服务开始旅程-- 创建一个 server.js 文件,写入: //最简单的 http 服务例子 var http = require("http"); ht ...

  8. IT168关于敏捷开发采访

    1.我们知道敏捷开发是一套流程和方法的持续改进,通过快速迭代的方式交付产品,从而控制和降低成本.但是在实行敏捷初期,往往看不到很好的效果.这里面,您觉得问题主要出在哪?团队应如何去解决问题?金根:我认 ...

  9. springMVC基础

    controllers包写控制器: @Controller @RequestMapping(value="/utils") public class UploadControlle ...

  10. 对Mathsapp的测试以及找bug

    组员博客地址: 练思明 卓嘉炜:http://www.cnblogs.com/luoliuxi/ 何宇明:http://www.cnblogs.com/40heyuming/ 团队贡献分: 练思明:2 ...