MD5:密码为web页面做准备,建议使用MD5
PASSWORD() :修改当前用户或其他用户密码
mysql> SELECT MD5('admin'); #对admin进行MD5的加密(32位)
+----------------------------------+
| MD5('admin') |
+----------------------------------+
| 21232f297a57a5a743894a0e4a801fc3 |
+----------------------------------+
1 row in set (0.01 sec)
mysql> SELECT PASSWORD('admin'); # 进行密码的计算
+-------------------------------------------+
| PASSWORD('admin') |
+-------------------------------------------+
| *4ACFE3202A5FF5CF467898FC58AAB1D615029441 |
+-------------------------------------------+
1 row in set (0.00 sec)
mysql>
mysql> SET PASSWORD=PASSWORD('dimitar'); #把当前用户密码修改为dimitar
Query OK, 0 rows affected (0.02 sec)