English 中文(简体)
C# - 未经预期的认证方法
原标题:C# - Unexpected authentication method mysql_native_password exception

我没有看到这方面的任何内容,但我早就试图用一个S-Q数据库取得一些实践。 我曾尝试过无国界医生组织,但徒劳无功,因此,我对MySQL进行了审判,并做了进一步的努力。 数据库似乎正在更新和运行,我甚至提出要表的问题。 虽然在试图与Microsoft s C# Express版本连接时,我有例外:“不投机的认证方法我sql_native_password” 我知道密码是正确的。 我甚至提到MySQL。 数据。 我在此守则中,我对联系有例外。 开放。 谁能帮助我?

     public Form1()
     {
      MySqlConnection connection = new MySqlConnection("Data Source = localhost;          Initial Catalog = MySQL55; Integrated Security = SSPI; User ID = root; Password = <REMOVED>;");

        try
        {
            connection.Open();
        }

        finally
        {
            if (connection != null)
            {
                connection.Close();
            }
        }
     }
最佳回答

What provider are you using? If you are using MySQL Connecter .net, then you connection string should be something like...

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

如果你使用电子信息信息传输器,那么......

Data Source=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Command Logging=false;

如果目标7

Host=myServerAddress;UserName=myUsername;Password=myPassword;Database=myDataBase;

如果是,

User ID=root;Password=myPassword;Host=localhost;Port=3306;Database=myDataBase; Direct=true;Protocol=TCP;Compress=false;Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;

如果有 MySQL 司机

Location=myServerAddress;Data Source=myDataBase;User ID=myUsername;Password=myPassword;Port=3306;Extended Properties="""";

如果是我的Sql OLEDB

Provider=MySQLProv;Data Source=mydb;User Id=myUsername;Password=myPassword;

如果是,Net OLEDB

Provider=MySQLProv;Data Source=mydb;User Id=myUsername;Password=myPassword;

如果MySQl联通

Driver={MySQL ODBC 5.5 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;

更多帮助可见http://www.linkionstrings.com/mysql”rel=“noretinger”>。 http://www.linkionstrings.com/mysql

It is actually much easier to use SQL Server as it is built in and VS is designed to work with it.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签