服务器之家:专注于服务器技术及软件下载分享
分类导航

Mysql|Sql Server|Oracle|Redis|

服务器之家 - 数据库 - Mysql - 基于mysql数据库的密码问题详解

基于mysql数据库的密码问题详解

2019-12-29 16:41MYSQL教程网 Mysql

本篇文章是对mysql数据库的密码问题进行了详细的分析介绍,需要的朋友参考下

今儿在做实验用到mysql数据库时,用户密码忘记了,让我也是找了半天:现在给大家介绍下我自己的方法:用到了mysql自身的函数来测试的。

复制代码代码如下:


mysql> select user,password,host from user;
+------+------------------+-----------+
| user | password         | host      |
+------+------------------+-----------+
| root | 773359240eb9a1d9 | localhost |
| root |                  | fsailing1 |
| root |                  | 127.0.0.1 |
| root | 309e1248634a4f61 | %         |
+------+------------------+-----------+
4 rows in set (0.00 sec)

 

mysql> password("root");
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
mysql> select password("root");
+------------------+
| password("root") |
+------------------+
| 67457e226a1a15bd |
+------------------+
1 row in set (0.00 sec)

mysql> select password("chen");
+------------------+
| password("chen") |
+------------------+
| 309e1248634a4f61 |
+------------------+
1 row in set (0.00 sec)

 

延伸 · 阅读

精彩推荐