在C#.net中连接MYSQL的远程数据库的问题 [英] Issue of Connecting a remote Database of MYSQL in C#.net

查看:126
本文介绍了在C#.net中连接MYSQL的远程数据库的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个Web应用程序来附加一个远程数据库的Mysql我已经使用了一个

Mysql连接器但是当我使用给定的用户ID和数据库密码运行应用程序时它显示了错误:访问被拒绝用户''parkhya_parkhya''@''rws5.my-hosting-panel.com''(使用密码:是)



我尝试了很多,但仍然没有找到任何解决方案来附加数据库所以请回复我为什么

我正面临这个问题。我做了什么在我的Web应用程序中解决了这个问题。

I Am Creating a Web Application to Attach a remote database of Mysql for which i have used a
Mysql Connector but When i am Running a application using given user id and password of database it Showing an error :"Access denied for user ''parkhya_parkhya''@''rws5.my-hosting-panel.com'' (using password: YES) "

I tried a lot but still not finding any Solution to attache a database so Please Reply me Why
I am Facing this Problem. and What i do Solve this Problem in My Web Application.

推荐答案

你好,



默认MySQL不允许来自远程计算机的连接。你必须启用它。在已安装MySQL的计算机上打开命令提示符。以下命令中的类型,用于向用户授予必要的权限。
Hello,

By default MySQL does not allow connections from remote machines. You will have to enable this. Open command prompt on the machine on which you have installed MySQL. The type in following command to grant the necessary privileges to the user.
GRANT ALL ON YOURDB.* TO 'parkhya_parkhya'@'rws5.my-hosting-panel.com' IDENTIFIED BY 'USER PASSWORD';

您还可以授予特定权限到USER而不是ALL。请查看MySQL手册[ ^ ]。



我假设 rws5.my-hosting-panel.com 是该机器的FQDN你正试图建立连接。如果名称解析不起作用,您甚至可以使用IP地址。



问候,

You can also GRANT specific privileges to the USER instead of ALL. Please have a look at MySQL Manual[^].

I am assuming that rws5.my-hosting-panel.com is the FQDN of the machine from where you are trying to establish the connection. You can even use IP Address, if name resolution is not working.

Regards,


这篇关于在C#.net中连接MYSQL的远程数据库的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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