gpt4 book ai didi

c# - MySql.Data.MySqlClient.MySqlException :“Access denied for user ' hobo' @'49.70.207.34'(使用密码 : YES)”

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

我想使用EntityFramework Core为IdentityServer4配置和操作数据。我使用Mysql。执行以下代码时发生错误。代码是"serviceScope.ServiceProvider.GetRequiredService<PersistedGrantDbContext>().Database.Migrate();"错误是

MySql.Data. MySqlClient. MySqlException: 'Access denied for user 'seen' @ '49.70.207.34' (using password: YES)' error.

但是我不知道地址49.70.207.34来自哪里,在我配置的数据库连接字符串中是另一个地址;我的连接字符串是'server=47......;database=IdentityServer4.Configuration;user=hobo;password=123456'.

最佳答案

您可以尝试这个方法

导入MySql.Data.MySqlClient

Public cn As New MySqlConnection()

Public Sub openconnection()
If cn.State <> ConnectionState.Open Then
cn.ConnectionString = "Server=website.com; Database=YourDatabaseName; Uid=YourUsername; Pwd=YourPassword"
cn.Open()
End If
End Sub

Public Sub closeconnection()
cn.Close()
End Sub

结束模块

关于c# - MySql.Data.MySqlClient.MySqlException :“Access denied for user ' hobo' @'49.70.207.34'(使用密码 : YES)”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54040611/

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