I'm trying to connect to a local MySQL database using Windows authentication (integrated security). I use the following connection string:
server=localhost;database=mydatabase;integratedsecurity=True
On MySqlConnection.Open()
I get a `NullReferenceException from somewhere deep inside. Here is the stack trace:
at MySql.Data.MySqlClient.Authentication.MySqlNativePasswordPlugin.MoreData(Byte[] data)
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.AuthenticationChange()
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.HandleAuthChange(MySqlPacket packet)
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate(Boolean reset)
at MySql.Data.MySqlClient.NativeDriver.Authenticate(String authMethod, Boolean reset)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
Some details about my setup:
Is this a bug in the server or in the connector? Or do I have an error in my connection string?
Windows authentication needs Windows Native Authentication Plugin to be installed and enabled. And this feature only available on their commercial (enterprise) edition. If you are using the community version, it seems that you cannot use this feature and use standard connection string:
server=server_address;uid=user_id;pwd=password;port=mysql_port;database=your_database