gpt4 book ai didi

asp.net - 无法在主机上使用 MySQL 连接

转载 作者:行者123 更新时间:2023-11-29 06:09:50 25 4
gpt4 key购买 nike

我正在构建一个网站,并将其部署在主机上,以测试它是否在线工作,因为时间表明它可以在本地工作,但由于某种原因部署时,它无法按预期工作。

因此,在我制作了一个小用户表单让用户从下拉菜单中进行选择之后,下拉菜单与在线的 MySQL 数据库进行了数据绑定(bind)。所以一般情况下一切都运行良好。

为了澄清我使用 Entity Framework ,模型是从 MySQL 数据库生成的。连接字符串保存在 web.config 中。

当我在主机上发布它时,当我使用下拉菜单转到该页面时,我收到错误:

无法找到请求的 .Net Framework 数据提供程序。它可能没有安装。描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.

Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

虽然MySQL数据库在同一台服务器上运行确实很奇怪,所以它安装在服务器上,而且我也在本地复制了我的网站使用的dll并将它们上传到主机。

更新:通过与托管提供商合作解决了这个问题,我发现他们没有添加mysql数据库的权限集,添加后问题就解决了。

最佳答案

你的方向很好,但是你的主机应该添加一些安全权限,以便你以这种方式使用 mysql 连接器 - 检查 MySql.Data in GAC, still SecurityException

关于asp.net - 无法在主机上使用 MySQL 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9655957/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com