[英]ERR_CONNECTION_RESET when trying to access localhost on ASP.NET Web App project
[英]ASP.NET web app throwing exception when trying to access MySQL database with user other than root
我试图避免使用我的root用户作为访问我的ASP.NET Web应用程序中的MySQL数据库的用户。 这是我的连接字符串:
<add name="MyConnectionString" providerName="MySql.Data.MySqlClient" connectionString="Data Source=90.232.111.231;Initial Catalog=mydb;User ID=root;Password=rootpassword;Convert Zero Datetime=True"/>
该应用程序使用该连接字符串没有问题。 但是,当我将连接字符串更改为:
<add name="MyConnectionString" providerName="MySql.Data.MySqlClient" connectionString="Data Source=90.232.111.231;Initial Catalog=mydb;User ID=myuser;Password=mypassword;Convert Zero Datetime=True"/>
我得到以下异常:
Parameter 'eturnValue' not found in the collection.
Exception Details: System.ArgumentException: Parameter 'eturnValue' not found in the collection.
这是在首次尝试访问数据库时登录。
我不知道eturnValue来自哪里,因为运行之间的唯一区别是我试图访问数据库的用户。 我确认我的mysql用户设置正确,它拥有root帐户所具有的所有权限,至少这是我主持人的支持告诉我的。
我通过C#中的MySql对象调用存储过程。
有些东西试图遍历集合中的项目(可能是它会寻找'ReturnValue'),但在某处它被输入'eturnValue',因此无法找到它。
由于我无法从您的异常详细信息中找出它的来源,您应该为'eturnValue'执行'在文件中查找' - 您可能会发现代码中存在拼写错误。 或者检查数据库中的存储过程是否相同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.