簡體   English   中英

ASP.NET Web應用程序嘗試使用root以外的用戶訪問MySQL數據庫時拋出異常

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM