Welcome 微信登录

首页 / 数据库 / MySQL / MySQL数据库的密码问题

今儿在做实验用到mysql数据库时,用户密码忘记了,让我也是找了半天:现在给大家介绍下我自己的方法:用到了mysql自身的函数来测试的。
  1. mysql> select user,password,host from user;  
  2. +------+------------------+-----------+  
  3. | user | password         | host      |  
  4. +------+------------------+-----------+  
  5. | root | 773359240eb9a1d9 | localhost |  
  6. | root |                  | fsailing1 |  
  7. | root |                  | 127.0.0.1 |  
  8. | root | 309e1248634a4f61 | %         |  
  9. +------+------------------+-----------+  
  10. 4 rows in set (0.00 sec)  
  11.   
  12. mysql> password("root");  
  13. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "password("root")" at line 1  
  14. mysql> select password("root");  
  15. +------------------+  
  16. | password("root") |  
  17. +------------------+  
  18. | 67457e226a1a15bd |  
  19. +------------------+  
  20. 1 row in set (0.00 sec)  
  21.   
  22. mysql> select password("chen");  
  23. +------------------+  
  24. | password("chen") |  
  25. +------------------+  
  26. | 309e1248634a4f61 |  
  27. +------------------+  
  28. 1 row in set (0.00 sec)  
Ubuntu MySQL 安装和用户登录Oracle 禁止操作系统认证登录相关资讯      MySQL数据库教程 
  • MySQL 处理非法数据  (04/09/2013 08:06:28)
  • MySQL关于timestamp和mysqldump的  (12/16/2012 13:25:41)
  • MySQL保证数据完整性  (12/16/2012 12:00:35)
  • ERROR 1130: mysql 1130连接错误的  (12/16/2012 13:29:08)
  • MySQL数据库教程:管理数据库和表(  (12/16/2012 12:47:02)
  • MySQL快速插入大批量数据存储过程  (11/05/2012 19:04:04)
本文评论 查看全部评论 (0)
表情: 姓名: 字数