mysql 用户名 长度_MySQL用户密码最大长度

bd96500e110b49cbb3cd949968f18be7.png

What is the maximum length for a MySQL user password?

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.

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

解决方案

This is the reference pages I found when I googled :

Link1 and

Link2

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

Fix documented in the 5.7.5 changelog, as follows:

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.

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值