IT技术博客大学习 共学习 共进步

mysql 1045(28000)错误

OracleDBA Blog 2011-01-30 19:28:33 浏览 5,483 次

今天不知道怎么了,在windowns 7上安装mysql,就是不成功,后来没有办法去,在http://dev.mysql.com/downloads/mysql/下了个免安装的版本,解压后,用是能用了。

给应用测试的人建立了一个测试的数据库和用户,奇怪的是,在本地登录没事,远程登录,无论如何都报10045(28000)错误。

C:\Windows\system32>mysql -uuism -h 172.16.9.43
ERROR 1045 (28000): Access denied for user ‘uism’@’172.16.5.20′ (using password:
YES)

检查系统的user表,发现结果如下:
mysql> select user ,host ,password from user;
+――+―――-+――――――+
| user | host | password |
+――+―――-+――――――+
| root | localhost | |
| root | 127.0.0.1 | |
| | localhost | |
| uism | localhost | 16cfa8943c7fb191 |
| uism | % | |
| uims | % | |
+――+―――-+――――――+
6 rows in set (0.00 sec)

用户在本地登录是好的,远程无论如何都不行,不管给不给密码。查询网络发现,需要将user表中那个用户名为空的用户干掉;

mysql> delete from user where user is null;
Query OK, 0 rows affected (0.00 sec)

mysql> delete from user where user =”;
Query OK, 1 row affected (0.00 sec)
这里看看,原来这个用户名还不是null,只是一个空字符串,晕倒。
然后,重新更新下权限,
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

再在客户端做链接:
C:\Windows\system32>mysql -uuism -h172.16.9.43
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 103
Server version: 5.1.47-community MySQL Community Server (GPL)

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

mysql>

Mysql怎么会有这么搞笑的问题,哈哈,而且那个用户的host为%的那个,密码为空,现在变成了远程不需要密码,本地需要密码,

建议继续学习

  1. 文件明明存在但是file_exists总是返回FALSE (阅读 4,904)
  2. Linux用户、用户组、文件权限学习笔记 (阅读 4,761)
  3. crontab异常,无法自动运行 (阅读 4,443)
  4. linux下如何自动提升权限 (阅读 4,444)
  5. (oracle)11g与10g中alter session权限差异 (阅读 4,383)
  6. ZooKeeper权限控制初探 (阅读 3,661)
  7. IIS写权限利用续以及写权限漏洞来由解释 (阅读 3,000)
  8. mysql的权限信息的存储 (阅读 2,900)
  9. 浅析Windows的访问权限检查机制 (阅读 2,602)
  10. 文件权限之粘滞位 (阅读 2,582)