代码改变世界

MySQL ODBC 3.51 Driver - Access Denied

2017-09-19 14:18  潇湘隐者  阅读(3218)  评论(0编辑  收藏  举报

MySQL ODBC 3.51 Driver - Access Denied

 

同事反馈在应用服务器上配置MySQL ODBC 3.51 Drive时,测试连接MySQL数据库时报下面错误:

 

 

ERROR [HYT00] [MySQL][ODBC 3.51 Driver]Access denied for user: 'xxx@xxxx' (Using password: YES)

 

 

那么出现这个错误,其实分多种情况:

 

 

 

1:账号密码错误或账号不存在。

 

 

    账号密码错误或不存在,就会报ERROR [HYT00] [MySQL][ODBC 3.51 Driver]Access denied for user: 'xxx@xxxx' (Using password: YES)这样错误。

 

 

2:账号密码存在特殊字符,例如特殊字符! @ # $ % ^ ?,那么也可能碰到这个错误。

 

 

创建一个测试账号test,密码包含一个特殊字符!

mysql> grant select on MyDB.* to test@'%' identified by 'Ac3435!6p';
 
Query OK, 0 rows affected (0.00 sec)
 
 
 
mysql> flush privileges;
 
Query OK, 0 rows affected (0.00 sec)

 

 

然后在一测试服务器上,配置MySQL ODBC时就会出现这个错误。如下截图所示,

 

 

clip_image001[6]

 

 

clip_image002[6]

 

 

 

搜索了一下,发现是MySQL ODBC 3.51不允许复杂密码,如下英文资料所示, 但是我下载安装MySQL ODBC 5.3测试发现, 这个版本是完全可以的。当然不清楚从那个版本开始,已经开始支持复杂密码了。这个很坑爹的特性确实让人很懵!

 

 

MySQL ODBC 3.51 No-Complex Password

 

Warning – You might have a serious headache with MySQL ODBC 3.51 if the password in your GRANT command contains special characters, such as ! @ # $ % ^ ?. MySQL ODBC 3.51 ODBC Driver does not support these special characters in the password box. The only error message you would receive is “Access denied” (using password: YES)

 

 

 

 

另外,如果网络不通、端口不通、或者MySQL服务没有启用,则会报Can't connect to MySQL server on 'xxxxxx'(10060)"这个错误。

 

clip_image003[6]