mysql使用什么样的散列? [英] What kind of hash does mysql use?

查看:100
本文介绍了mysql使用什么样的散列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写我自己的代码,类似于phpMyAdmin。但我需要用户能够使用他们的用户名和密码从MySQL数据库登录。我需要知道mysql数据库使用哪种散列来存储每个用户的密码。我检查了dev.mysql.com的答案,但找不到任何东西,除了以*开头的新的41字节哈希。 p>我不认为你能够解密MySQL表中的密码,并且使用存储在 mysql 中的密码是没有用的。用户表。



您应该使用 User 时设置的密码在您的应用程序中创建,如果您丢失了用户密码,那么您可以使用 mysqladmin
$ b


为'user-name-here'设置密码'@'hostname-name-here'= PASSWORD('new-password-here');


I'm writing my own code similar to phpMyAdmin. But I'll need the user to be able to sign on using their username and password from the mysql database. I need to know what kind of hash the mysql database uses to store each users password. I checked dev.mysql.com for answers but couldnt find anything, other than its the newer 41 byte hash beginning with an *.

解决方案

I don't think you will be able to decrypt password stoed in MySQL table and it's of no use using password which is stored in mysql.user table.

You should be using password that is being set when User is created in your application, If you have lost password of users then you can reset it using mysqladmin

SET PASSWORD FOR 'user-name-here'@'hostname-name-here' = PASSWORD('new-password-here');

这篇关于mysql使用什么样的散列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆