主机...连接到在线 MySQL 数据库时,ODBC 连接中不允许出现错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6211501/
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 20:06:44  来源:igfitidea点击:

Host...not allowed error in ODBC connection, while connecting to an online MySQL database

mysqlodbcdatabase-connectiondsn

提问by sqlchild

I have downloaded MySQL ODBC Connector 5.1. Now am trying to setup the DSN. But am getting the error:

我已经下载了 MySQL ODBC 连接器 5.1。现在正在尝试设置 DSN。但我收到错误:

Connection Failed : [HY000] [MySQL] [ODBC 5.1 Driver]Host '117.x.x.x' is not allowed to connect to this MySQL server

Connection Failed : [HY000] [MySQL] [ODBC 5.1 Driver]Host '117.x.x.x' is not allowed to connect to this MySQL server

My server url is server.myweb.com - this name am entering in the TCP/IP Server and Port =3306.

我的服务器 url 是 server.myweb.com - 这个名称是在 TCP/IP 服务器和端口 =3306 中输入的。

I have also entered the userid and password , which is the one which i enter when i open www.myweb.com/cpanel

我还输入了用户名和密码,这是我打开 www.myweb.com/cpanel 时输入的

Is this a version problem? Should the version of MySQL on my server also be 5.1, i.e. the one of the ODBC?

这是版本问题吗?我的服务器上的 MySQL 版本是否也应该是 5.1,即 ODBC 之一?

Please help.

请帮忙。

回答by Mauricio Palacios

Run MySQL Workbench and Login

运行 MySQL Workbench 并登录

Go to Users and Privilegies

转到用户和权限

Select the User and Change Limit Connectivity to Hosts Matching with %

选择用户并更改与 % 匹配的主机的连接限制

And Save the changes

并保存更改

回答by Devart

It is not a version or ODBC problem. This error says there is no user with specified host name. Read more information in MySQL reference - http://dev.mysql.com/doc/refman/5.1/en/grant.html#grant-accounts-passwords

这不是版本或 ODBC 问题。此错误表示没有指定主机名的用户。在 MySQL 参考中阅读更多信息 - http://dev.mysql.com/doc/refman/5.1/en/grant.html#grant-accounts-passwords

回答by TallTed

As others have said, this issue is not about the version of any component.

正如其他人所说,这个问题与任何组件的版本无关。

When clients (ODBC or otherwise) try to connect to MySQL, the server checks the username and password andthe originating host identity against its permissions tables. This KB articlemay help you resolve the issue.

当客户端(ODBC 或其他)尝试连接到 MySQL 时,服务器会根据其权限表检查用户名和密码以及原始主机身份。 这篇知识库文章可能会帮助您解决问题。

回答by user2103520

in cpanel under database there is an option "remote MySQL" select the option. It will redirect to "Remote database Access Host" add your IP '117.x.x.x' . After adding you ip to remote MySQL the cpanel check the connection....

在数据库下的 cpanel 中有一个选项“远程 MySQL”选择该选项。它将重定向到“远程数据库访问主机”,添加您的 IP '117.xxx' 。将您的 ip 添加到远程 MySQL 后,cpanel 检查连接....

Note- if your ip is dynamic remove the old ip and add the new ip to Remote MySQL in you cpanel....

注意-如果您的 ip 是动态的,请删除旧 ip 并将新 ip 添加到您的 cpanel 中的远程 MySQL ....