1  用以往的mysql登陆模式登陆

[mysql@eanintmydbc002db1 mysqllog]$ mysql

Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3157186

Server version: 5.5.25a-log MySQL EA Release

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select current_user();

+----------------+

| current_user() |

+----------------+

| @localhost     |

+----------------+

1 row in set (0.01 sec)

mysql> 

mysql>


2 奇怪,再次登陆试试看


[mysql@xxxmydbc002db1 mysqllog]$ mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3157145

Server version: 5.5.25a-log MySQL EA Release

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show processlist;


ERROR 1227 (42000): Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
mysql> select current_user();

+----------------+

| current_user() |

+----------------+

| @localhost     |

+----------------+

1 row in set (0.00 sec)

看到这里竟然没有用户名,只有ip地址为localhost,好诡异的状况,看下当前所有的进程

mysql> show full processlist;


ERROR 1227 (42000): Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
mysql>

3 去用标准的登陆模式mysql -uroot -p -hlocalhost登陆试下,看看问题到底在哪里。

[novamysqladminint@xxmydbc002db1 ~]$ mysql -uroot -p -hlocalhost
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3257823
Server version: 5.5.25a-log MySQL EA Release

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select user,host from mysql.user;
+--------------+-------------------------------------+
| user         | host                                |
+--------------+-------------------------------------+
| mmm_agent    | %                                   |
| mmm_monitor  | %                                   |
| replication  | %                                   |
| root         | %                                   |
| root         | 127.0.0.1                           |
| root         | ::1                                 |
|              | localhost                           |  有这个用户的,那就查下用户到底是啥权限.
| nuc_monitor  | xx.xx.abn-iad.xx.com |
| nuc_monitor  | xx.xx.abn-iad.xx.com |
+--------------+-------------------------------------+
23 rows in set (0.00 sec)

mysql> show grants for ''@'localhost';
+--------------------------------------+
| Grants for @localhost                |
+--------------------------------------+
| GRANT USAGE ON *.* TO ''@'localhost' |  看到这里,这个用户只赋予了useage权限,可以connect上面,但是做不了任何操作。
+--------------------------------------+
1 row in set (0.00 sec)

mysql>

解决方案:这个表示你的权限已经被收回了.但是user表里面还有你的记录.你需要做的是,重新赋予这个用户权限或者 drop掉这个无用的帐号换一个标准的帐号登陆。

Why ?

在binlog里面去查看了操作记录以及自己平时的工作记录,发现当时一个同事在清理帐号的时候,remove了''@'localhost'的权限,但是没有drop 掉这个用户,所以在默认mysql登陆的时候,优先选择了''@'localhost',而不是用'root'@'localhost',但是问题来了,为什么执行mysql会优先用''@'localhost'帐号登陆,而不用'root'@'localhost'登陆呢?

ERROR 1227 (42000): Access denied; you need (at least one of) the PROCESS privilege(s) for this oper的更多相关文章

  1. ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation

    开启super权限: 1. update user set Super_priv=‘Y’ where User=‘root’2. flush privileges

  2. ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'mysql'

    mysql> use mysqlERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'mysql' ...

  3. ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'db'

    1.问题 在刚刚安装MySQL之后,进入到mysql环境下,创建数据库,出现下面的提示信息: ERROR 1044 (42000): Access denied for user ''@'localh ...

  4. mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database

    新安装的mysql密码是空的. ./mysql -u root -p use mysql SELECT `Host`,`User` FROM user; UPDATE user SET `Host` ...

  5. ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'

    在我想把备份的数据库导入到本地数据的时候,发生这个错误,我使用的工具是dbForge Studio for MySQL ERROR 1044 (42000): Access denied for us ...

  6. ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

    提示:ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'.前两天也出现过这个问题,网上找了一个比 ...

  7. MySQL:ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

    ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'. 原因是:mysql数据库的user表里,存 ...

  8. 基于mysql创建库的报错解决小记mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database

    mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database异常处理 1.找到find / -name my. ...

  9. ERROR 1044 (42000): Access denied for user 'root'@'localhost'

    从供应商那边接手一个MySQL数据库(数据库版本为5.7.21 MySQL Community Server (GPL)),在创建账号时遇到了"ERROR 1044 (42000): Acc ...

随机推荐

  1. hdu 1573 x问题(中国剩余定理)HDU 2007-1 Programming Contest

    只是套模板而已(模板其实也不懂). 留着以后好好学的时候再改吧. 题意—— X = a[i] MOD b[i]; 已知a[i],b[i],求在[1, n]中存在多少x满足条件. 输入—— 第一行一个整 ...

  2. C# chart绑定数据的方式整理

    C#chart 画图曲线的条数决定是你的数据源也就Series.Series是对象 你动态创建就可以了. 一.数组, List 等简单Collection类型的方式 Series s1= new Se ...

  3. java jvm学习笔记十三(jvm基本结构)

    欢迎装载请说明出处:http://blog.csdn.net/yfqnihao 这一节,主要来学习jvm的基本结构,也就是概述.说是概述,内容很多,而且概念量也很大,不过关于概念方面,你不用担心,我完 ...

  4. ThinkAndroid是简洁,快速的进行Android应用程序的框架

    ThinkAndroid简介ThinkAndroid是一个免费的开源的.简易的.遵循Apache2开源协议发布的Android开发框架,其开发宗旨是简单.快速的进行Android应用程序的开发,包含A ...

  5. Android引用百度定位API第三方组件后导致其它.so文件无法正常加载的问题

    查看当前调试设备CPU架构的方法: adb.exe shell getprop ro.product.cpu.abi  (一般返回值为:armeabi-v7a) adb.exe shell getpr ...

  6. Matlab中imshow()函数的使用

    imread() 返回的图像类型是uint8类型, 这时用imshow显示图像的时候, imshow会认为输入矩阵的范围在0-255, 如果imshow的参数为double类型的,那么imshow认为 ...

  7. Lucene学习笔记: 五,Lucene搜索过程解析

    一.Lucene搜索过程总论 搜索的过程总的来说就是将词典及倒排表信息从索引中读出来,根据用户输入的查询语句合并倒排表,得到结果文档集并对文档进行打分的过程. 其可用如下图示: 总共包括以下几个过程: ...

  8. 第二百五十三、四、五天 how can I 坚持

    出去玩了几天,好累啊. 周五,坐了半天车.到了西柏坡,下午撕名牌,好疯狂啊,最终还是以有人受伤为代价结束了战斗.晚上吃蛋糕.水饺,还有面条,就是我的奖品没拿到.哎.. 周六,上午滑雪,两年没滑了,都忘 ...

  9. iOS Launch Images name

    4.0 inch screen:Default-568h@2x.png (old 640x1136 ~ for iPhone 5) 4.0 inch screen: LaunchImage-700-5 ...

  10. HDU 5656 CA Loves GCD (数论DP)

    CA Loves GCD 题目链接: http://acm.hust.edu.cn/vjudge/contest/123316#problem/B Description CA is a fine c ...