1 error登陆错误[uxxx@exxx-0702 ~]$ mysql -hexxx-tx.com --user='mmm_agent' --password='#tx$'
ERROR 1045 (28000): Access denied for user 'mmm_agent'@'exxx-tx.com' (using password: YES)
2 去掉-h参数,能顺利登陆[uxxx@exxx-0702 ~]$ mysql --user='mmm_agent' --password='#tx$'
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 491
Server version: 5.x.xa-log MySQL tx Reltxse
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 cltxr the current input statement.
mysql>
3 难道是对于-h参数有限制?我换个用户试试看mysql> GRANT ALL PRIVILEGES ON *.* TO 'mg'@'%' IDENTIFIED BY '#tx$';
Query OK, 0 rows affected (0.01 sec)
mysql> exit
[uxxx@exxx-0702 ~]$ mysql -hexxx-tx.com --user='mg' --password='#tx$'
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 965
Server version: 5.x.xa-log MySQL tx Reltxse
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 cltxr the current input statement.
mysql>
看来不是对于-h参数的限制问题,应该是别的故障,密码是OK的。4 去查看mmm_agent用户吧。mysql> select user,host from mysql.user where user='mmm_agent';
+-----------+------+
| user | host |
+-----------+------+
| mmm_agent | % |
| mmm_agent | 10.% |
+-----------+------+
2 rows in set (0.00 sec)
mysql> show grants for mmm_agent@'%';
+-------------------------------------------------------------------------------------------------------------------+
| Grants for mmm_agent@% |
+-------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'mmm_agent'@'%' IDENTIFIED BY PASSWORD '*77074D8AC9603904375ED54F1D2E14CDACB7842F' |
+-------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> show grants for mmm_agent@'10.%';
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for mmm_agent@10.% |
+--------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT RELOAD, PROCESS, SUPER, REPLICATION CLIENT ON *.* TO 'mmm_agent'@'10.%' IDENTIFIED BY PASSWORD '*6745119376CF6BD5E0F0A50484A91AE7BD172612' |
| GRANT EXECUTE ON `audit`.* TO 'mmm_agent'@'10.%' |
+--------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql>
-- 看到这里有2个帐号,相同 用户名,不同host,而且密码也不相同,那么我将host为10.%的mmm_agent用户的密码修改成与host为%的mmm_agent用户一样的密码,试试看。GRANT RELOAD, PROCESS, SUPER, REPLICATION CLIENT ON *.* TO 'mmm_agent'@'10.%' IDENTIFIED BY '#tx$';
GRANT EXECUTE ON `audit`.* TO 'mmm_agent'@'10.%'
mysql> GRANT RELOAD, PROCESS, SUPER, REPLICATION CLIENT ON *.* TO 'mmm_agent'@'10.%' IDENTIFIED BY '#tx$';
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT EXECUTE ON `audit`.* TO 'mmm_agent'@'10.%'
-> ;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[uxxx@exxx-0702 ~]$ mysql -hexxx-tx.com --user='mmm_agent' --password='#tx$'
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1191
Server version: 5.x.xa-log MySQL tx Reltxse
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 cltxr the current input statement.
mysql>
-- 用-h参数登陆mysql成功了。
[总结]:
嗯,可以了,使用[uxxx@exxx-0702 ~]$ mysql -hexxx-tx.com --user='mmm_agent' --password='#tx$' 登陆成功了。
mysql在调用-h参数的时候,如果用户名相同,在host的选择上面,先去匹配范围小的用户,在这个案例中, %比10.%的范围要大得多,所以再用 -hexxx-tx.com -ummm_agent访问的时候直接匹配范围小的10.%用户了,而恰巧mmm_agent@'10.%'用户的密码与mmm_agent@'%'用户的密码不是一样的,就报了如下密码错误的提示:
ERROR 1045 (28000): Access denied for user 'mmm_agent'@'%' (using password: YES)
分享到:
相关推荐
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决: 1.打开在创建mysql容器时挂载的conf目录下的mysqld.cnf(如下文件) 我创建docker的姿势 2.进入mysqlId.cnf文件中在...
首先是不知道怎么忽然mysql用命令行,workbench都登录不了,都提示’Access denied for user ‘root’@’localhost’。 数据库卸载重装了几次都不行。好像感觉数据清理不干净。解决的过程遇到的坑,这里记录分享下。...
昨天连数据库没有问题,但是今天连接数据库就报这个错误了,网上也搜了不少的方法,有一个方法解决了我的问题。...mysql> use mysql; mysql> update user set password=password("你的新密码") where user="root"; m
Unhandled rejection SequelizeAccessDeniedError: Access denied for user 'lupeng'@'localhost' (using password: YES) 这是Node在使用Sequlize连接Mysql数据时报的错,关键看冒号后面的错误:访问拒绝,关键是...
主要介绍了Linux下数据库报ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)实用解决方案,希望能对大家有帮助。
Mysql中添加用户之后可能出现登录时提示ERROR 1045 (28000): Access denied for user的错误.
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) 第一步:编辑mysql安装目录中的配置文件my.ini,在[mysqld]这个条目下加入 skip-grant-tables 如下图: 保存退出后 第二...
前言 最近学习linux,然后将win换成了ubuntu。之前安装的mysql也不能用了,现在将在ubuntu18.0.4上安装mysql并将...登录时出现ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’。这应该时我们之前
MySQL ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO) 的解决办法和原因 这两天下载了MySQL5.7.11进行安装,发现到了初次使用输入密码的时候,不管怎样都进不去,即使...
主要给大家介绍了关于Linux连接mysql数据库报错:Access denied for user ’root‘@’localhost‘(using password: YES)的解决方法,文中通过示例代码介绍的非常详细,需要的朋友可以参考借鉴,下面随着小编来一起...
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) 提示的是用户访问被拒绝,原因是密码不正确,但是我们明明配置的是正确的密码,原因就在yml中: spring: datasource: ...
主要给大家介绍了如何解决mysql在创建数据库后出现:Access denied for user 'root'@'%' to database 'xxx'的错误提示,文中介绍的非常详细,需要的朋友可以参考借鉴,下面来一起看看吧。
Access denied for user 'root'@'localhost' (using password: YES) 在网上找了很多解决办法,但是基本只有一个,在.ini文件中的mysqld条目添加 skip-grant-tables 然后重启服务器,再按照刚刚的步骤再来一遍(最后...
最近在工作中遇到一个问题,在创建数据库后连接数据库的时候居然报错了,错误代码是Access denied for user ‘root’@’%’ to database ‘xxx’,通过查找相关的资料终于解决了这个问题,所以想着总结下来分享给有...
编辑mysql配置文件my.ini(如果是my_default.ini请改名为my.ini),在[mysqld]这个条目下加入 ...这时候在cmd里面输入mysql -u root -p就可以不用密码登录了,出现password:的时候直接回车可以进入,不会出现ERROR
主要介绍了MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 的原因分解决办法的相关资料,需要的朋友可以参考下
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES) 1、当时我看到这个错误的时候,我专门多试了几次密码,但是密码明明正确啊,然后,我还用sqlyong工具进行连接也可以连接...
ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘python’ 2. 解决方法: 执行以下命令进入控制台: mysql –user=root -p 输入root用户的密码即可进入mysql控制台: 创建数据库: ...
主要介绍了ubuntu18.0.4安装mysql并解决ERROR 1698 (28000): Access denied for user 'root'@'localhost',现在将ubuntu18.0.4上安装mysql并将碰到的问题记录下来,感兴趣的朋友一起看看吧