gpt4 book ai didi

mysql - Arvixe 共享主机,MYSQL 数据库的表单例份验证错误

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

我有我的实时数据库中存在的所有表单例份验证数据库表的完整副本,我可以看到数据在那里,我可以在我的应用程序上连接和查看单独的数据......但是当我尝试登录时我的网站我得到一个

建立与 SQL Server 的连接时发生了与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接。 (提供程序:SQL 网络接口(interface),错误:26 - 定位指定的服务器/实例时出错)

然后潜在的错误似乎是它正在尝试创建一组新的用户身份验证表,因为它无法连接到我的 MYSQL 数据库。我之所以这样说是因为堆栈跟踪错误:

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5103182
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +260
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +389
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject, Boolean withFailover) +197
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +963
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +316
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5119675
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +31
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +76
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlConnection.Open() +125
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +82

**[HttpException (0x80004005): Unable to connect to SQL Server database.]**
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +137
System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +94
System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +27
System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +395

我的 Web.config 文件看起来像

<remove name="LocalMySqlServer" />


<add name="mydbEntities" connectionString="metadata=res://*/DataEntity.csdl|res://*/DataEntity.ssdl|res://*/DataEntity.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=servername;User Id=id;password=password;Persist Security Info=True;database=mydb&quot;" providerName="System.Data.EntityClient" />
<add name="MySqlMembershipConnection" connectionString="server=localhost; user id=id; password=password; persist security info=true; database=mydb;" providerName="MySql.Data.MySqlClient"/>

<roleManager enabled="true" />
<membership defaultProvider="MySqlMembershipProvider">
<providers>
<clear />
<add name="MySqlMembershipProvider"
type="MySql.Web.Security.MySQLMembershipProvider,
MySql.Web,
Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
autogenerateschema="true"
connectionStringName="MySqlMembershipConnection"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
applicationName="/" />
</providers>
</membership>

我不确定为什么找不到我的 MYSQL 数据库或者是什么事件链导致登录过程失败。

最佳答案

这个问题归结为我没有指定完整的成员资格、配置文件和 roleManager 选项集。一旦我填写了这些并将我的应用程序定向到我的 MySQL 数据库,它就停止尝试创建它自己的数据库来处理这些功能。下面是我的 web.config 文件需要包含的 3 个部分的示例...希望这可以避免其他人遇到我的挫败感,我得说 Arvxie 支持在这个问题上没有帮助。

<membership defaultProvider="MySqlMembershipProvider">
<providers>
<clear />
<add name="MySqlMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" autogenerateschema="false" connectionStringName="MySqlMembershipConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="MySqlMembershipConnection" applicationName="/" />
</providers>
</profile>
<roleManager enabled="true" defaultProvider="MySQLRoleProvider">
<providers>
<add connectionStringName="MySqlMembershipConnection" applicationName="/" name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</providers>
</roleManager>

关于mysql - Arvixe 共享主机,MYSQL 数据库的表单例份验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10606570/

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