MySQL用户密码最大长度 [英] Maximum MySQL user password length

查看:2051
本文介绍了MySQL用户密码最大长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySQL用户密码的最大长度是多少?

What is the maximum length for a MySQL user password?

MySQL使用 PASSWORD(str) 来加密明文密码str.此哈希密码字符串以CHAR(41)数据类型存储在mysql.user授予表中.

MySQL uses PASSWORD(str) to encrypt the cleartext password str. This hashed password string is stored in the mysql.user grant table with a CHAR(41) datatype.

但是,我找不到明文密码str的最大长度(如果有).有人可以帮忙吗?

However, I was not able to find what is the maximum length for the cleartext password str, if there is one. Can anyone help?

推荐答案

这是我在Google上搜索时找到的参考页面: Link1 Link2

This is the reference pages I found when I googled : Link1 and Link2

如果您正在使用MySQL复制,请注意,当前 复制从属服务器将其用作CHANGE MASTER TO的密码 声明的有效长度限制为32个字符;如果 密码更长,任何多余的字符都将被截断.这不是 通常是由于MySQL Server施加的任何限制,而实际上是 MySQL复制特有的问题. (有关更多信息,请参见错误43439 .)

If you are using MySQL Replication, be aware that, currently, a password used by a replication slave as part of a CHANGE MASTER TO statement is effectively limited to 32 characters in length; if the password is longer, any excess characters are truncated. This is not due to any limit imposed by the MySQL Server generally, but rather is an issue specific to MySQL Replication. (For more information, see Bug 43439.)

修复了 5.7中记录的问题. 5个变更日志,如下:

CHANGE中可用于密码的最大长度 MASTER TO语句为32个字符.以前,当更长的时间 使用了密码,任何多余的长度都被无声地截断了 由服务器.现在,当密码的长度超过32 个字符,则"CHANGE MASTER TO"失败并出现错误.

The maximum length that can be used for the password in a CHANGE MASTER TO statement is 32 characters. Previously, when a longer password was employed, any excess length was silently truncated by the server. Now when the password's length exceeds 32 characters, CHANGE MASTER TO fails with an error.

所以我可以放心地假设我的密码不能超过32个字符.

So I would safely assume my password should not be more than 32 characters.

这篇关于MySQL用户密码最大长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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