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

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

问题描述

我正在编写自己的代码,类似于 phpMyAdmin.但我需要用户能够使用 mysql 数据库中的用户名和密码登录.我需要知道 mysql 数据库使用哪种散列来存储每个用户的密码.我检查了 dev.mysql.com 的答案,但找不到任何东西,除了以 * 开头的较新的 41 字节哈希.

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 *.

推荐答案

我不认为你将能够解密存储在 MySQL 表中的密码,使用存储在 mysql 中的密码也没有用.<代码>用户表.

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.

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

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

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

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

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

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