MYSQL 错误 2049 (HY000):使用旧(4.1.1 之前)身份验证协议引用的连接(启用客户端选项“secure_auth”)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18126513/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 18:29:02  来源:igfitidea点击:

MYSQL ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol ref used (client option 'secure_auth' enabled)

mysqlauthentication

提问by Praveen Prasannan

when I tried to restore all database dump which is in 5.0 version to 5.6 version, it got restored and after that when I tried to reconnect, am getting the following error

当我尝试将 5.0 版本的所有数据库转储恢复到 5.6 版本时,它恢复了,之后当我尝试重新连接时,出现以下错误

ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol ref used (client option 'secure_auth' enabled)..

ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol ref used (client option 'secure_auth' enabled)..

I have tried adding the following lines in My.ini and restarted the service,but the issue persist till.

我尝试在 My.ini 中添加以下几行并重新启动服务,但问题一直存在。

skip-grant-tables

The following link says its a bug in MYSQL.

以下链接说它是 MYSQL 中的一个错误。

https://github.com/santisaez/powerstack/blob/master/packages/mysql/mysql-powerstack-secure_auth.patch

https://github.com/santisaez/powerstack/blob/master/packages/mysql/mysql-powerstack-secure_auth.patch

Do anyone have any fixes for this solution?

有没有人对此解决方案有任何修复?

回答by rayVenues

Use this workaround for MySQLWorkBench 6.0 at the Manage Server Connections Dialog Box:

在“管理服务器连接”对话框中对 MySQLWorkBench 6.0 使用此解决方法:

Add useLegacyAuth=1 in the Advanced options box in the connection settings dialog.

在连接设置对话框的高级选项框中添加 useLegacyAuth=1。

回答by ShaunOReilly

On the command line, use something like the following, if you have no choice...

在命令行上,如果您别无选择,请使用以下内容...

mysql -uTheUseerNAme -pThePassword DbName -h HostName --skip-secure-auth

Hope this helps someone, as this was my problem connecting from a Linux box

希望这对某人有所帮助,因为这是我从 Linux 机器连接的问题

回答by Thermech

Best thing to do is to reset your user password to the new hashing algorithm

最好的办法是将您的用户密码重置为新的散列算法

With workbench: http://blogs.technicise.com/change-root-password-in-mysql-workbench/

使用工作台:http: //blogs.technicise.com/change-root-password-in-mysql-workbench/

Command line: http://www.cyberciti.biz/faq/mysql-change-root-password/

命令行:http: //www.cyberciti.biz/faq/mysql-change-root-password/

回答by Digant

Fixed as of MySQL Workbench 6.0.7, and here's the changelog entry:

从 MySQL Workbench 6.0.7 开始修复,这里是更改日志条目:

A new option was added in the connection settings "Advanced" tab for disabling the secure_auth (useLegacyAuth) option, to optionally connect to legacy systems.

在连接设置“高级”选项卡中添加了一个新选项,用于禁用 secure_auth (useLegacyAuth) 选项,可选择连接到旧系统。

enter image description here

在此处输入图片说明

回答by PeterVermont

For MySQL Workbench 6.08 in the Manage Server Connections, Connection tab, Advanced sub-tab you must check the box 'Use the old authentication protocol.'

对于 MySQL Workbench 6.08,在 Manage Server Connections、Connection 选项卡、Advanced 子选项卡中,您必须选中“Use the old authentication protocol”框。

回答by Alex

I've got same problem in Centos 7 with MySQL. If i try to connect by mysql client:

我在 Centos 7 和 MySQL 中遇到了同样的问题。如果我尝试通过 mysql 客户端连接:

ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)

错误 2049 (HY000):使用旧(4.1.1 之前)身份验证协议的连接被拒绝(客户端选项“secure_auth”已启用)

Bu in my case if I specify:

在我的情况下,如果我指定:

--skip-secure-auth

--skip-secure-auth

it cause error message:

它导致错误消息:

ERROR 1275 (HY000): Server is running in --secure-auth mode, but 'root'@'localhost' has a password in the old format; please change the password to the new format

错误 1275 (HY000):服务器在 --secure-auth 模式下运行,但 'root'@'localhost' 有一个旧格式的密码;请将密码更改为新格式

It work only when i specify:

它仅在我指定时才起作用:

in /etc/my.cnf

在 /etc/my.cnf

[mysqld]
...
secure_auth=false

and then restart mysqld

然后重启mysqld

回答by nobjta_9x_tq

Using the way like rayVenues but you should change your password connection, it will work fine :)

使用 rayVenues 之类的方式,但您应该更改密码连接,它会正常工作:)

回答by Dmgx

I had similar issue, but using MAC Terminal connecting remote MySQL db.

我有类似的问题,但使用 MAC 终端连接远程 MySQL 数据库。

Solution: I create a new user with less special characters, that problem disappeared.

解决方案:我创建了一个具有较少特殊字符的新用户,该问题消失了。