问题描述:

用户已建,权限已赋予。long long ago这个用户是可以正常访问的,但是今天它就不能访问了。报错如下:

ERROR 1045 (28000): Access denied for user 'lf'@'172.17.215.11' (using password: YES)

排障过程:

select user,host,password  from mysql.user;
….
| lf| localhost | *5A4CAF734551B5347FEC1171CEB89D503693C1B4 |
+--------------+---------------+-------------------------------------------+
select password(‘LF98$xxi’);
+-------------------------------------------+
| password('LF98$xxi') |
+-------------------------------------------+
| *5A4CAF734551B5347FEC1171CEB89D503693C1B4 |
+-------------------------------------------+
1 row in set (0.05 sec)

但是登录就是报错

[root@vhost02 ~]# mysql -ulf -pLF98$xxi
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'lf'@'localhost' (using password: YES)

难道是权限没有刷新?

[root@vhost02 ~]# mysql -uroot -p
...
mysql>flush privileges;

重新登录仍然失败。。。

最终解决方式:

就在小编半晕半醒之间忽然灵光一现,用户名和密码分开输入吧,于是:

[root@vhost02 ~]# mysql -ulf -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 180
Server version: 5.6.25-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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>

成功登录了。原因居然是密码里含有$符号。特殊字符需要慎用,用不好就把自己给坑了。不过密码有$符号,并不影响它在脚本,程序里的使用。$的特殊性应该和系统命令有关。

诡异的 ERROR 1045 (28000): Access denied for user 错误的更多相关文章

  1. 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 ...

  2. MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的真正原因

    在博客Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N ...

  3. 升级到macOS 10.12 mysqlb报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    系统升级到macOS 10.12后启动mysql后,在终端输入mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' ...

  4. 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)) 修改: # ...

  5. 安装mysql因为/tmp权限不足而导致ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)的解决方案

    本机是centos 6.5  安装的mysql是5.1的版本. 在安装mysql之后,第一次启动mysql服务的时候,需要/tmp有777(rwxrwxrwx)的权限,然而楼主的/tmp是755(rw ...

  6. MySQL5.5出面ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题的解决办法

    问题描述 安装完MySQL5.5数据库,使用Navicat Premium以及命令窗口连接数据库都报以下错误: ERROR 1045 (28000): Access denied for user ' ...

  7. MySQL学习笔记——ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Enter password: E ...

  8. Linux 下,mysql数据库报无法登陆错误:ERROR 1045 (28000): Access denied for use

    今天在别人的服务器上登录mysql发现无法登陆(Mysql别人实现安装好的) 密码和用户名都是正确的,但登录后报如下错误: ERROR 1045 (28000): Access denied for ...

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

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) ERROR 2013 (HY00 ...

随机推荐

  1. 交叉编译libudev

    一.交叉编译libudev下载udev-182.tar.xz 下载网址:https://mirrors.edge.kernel.org/pub/linux/utils/kernel/hotplug/ ...

  2. 31-mysql 代码建立数据库

    给个例子,模仿即可: drop database if exists tt; create database tt default character set utf8; use tt; create ...

  3. 【MINA学习笔记】—— 1.体系结构分析[z]

    前言 Apache的MINA框架是一个早年非常流行的NIO框架,它出自于Netty之父Trustin Lee大神之手.虽然目前市场份额已经逐渐被Netty取代了,但是其作为NIO初学者入门学习框架是非 ...

  4. 梦殇 chapter two

    梦殇 chapter two 早晨,推开门.一缕阳光照进来. 今天的天气并不像往日,少了些往日的寒冷与萧瑟.阳光照耀着大地,暖暖的.已经好久见不到太阳了.最近雾气渐入这座城市,使它全部笼罩在阴阴的雾气 ...

  5. mysql 添加权限和撤销权限的实例(亲测可行)

    将当前数据库的表role_modules 的select权限赋予给用户uwangq: GRANT SELECT ON role_modules TO uwangq@'%' IDENTIFIED BY ...

  6. Triangle2D类(Java)

    定义Triangle2D类,包含: 三个名为p1.p2和p3的MyPoint型数据域,这三个数据域都带有get和set方法.MyPoint在练习题10.4中定义. 一个无参构造方法,该方法创建三个坐标 ...

  7. iOS.Location-Based Service

    基于位置区域的服务 1. 背景 Ref[1] 在iOS设备锁屏的状态下,App的icon会出现在屏幕的左下角. iOS 8 Feature: Location-based Lockscreen App ...

  8. centos 6.5 上安装 nvm

    NVM 重磅推出NVM curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash Clos ...

  9. mysql 8小时timeout问题

    MySQL> show variables like '%timeout%'; +--------------------------+-------+ | Variable_name      ...

  10. [Chrome Headless + Python] 截长图 (Take Full-page Screenshot)

    # -*- coding: utf-8 -*- import time import os from selenium import webdriver from selenium.webdriver ...