0

I am getting

at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
   at MySql.Data.MySqlClient.NativeDriver.Authenticate411()
   at MySql.Data.MySqlClient.NativeDriver.Authenticate()
   at MySql.Data.MySqlClient.NativeDriver.Open()
   at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
   at MySql.Data.MySqlClient.MySqlConnection.Open()

when trying to connect to the local database using a .Net application. I updated MySQL from 5.6.34 to 8.0 and this could be the problem.

I granted all privileges to root and added another root user with '%' as host, created a new user and grant it all the privileges but none of that worked. The root and the accounts I added work fine through the command line and another python script I created to test the connection but not through the app I am trying to use. I also tried to add skip-grant-tables to my.ini and restart the service but couldn't start if after adding that line.

| user             | host      |
+------------------+-----------+
| amine            | %         |
| root             | %         |
| amine            | localhost |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |

I am not sure but could it be the .Net connector version that could cause that Error as the version we used to use is older than the one installed now. Thanks

Amine Mchayaa
  • 104
  • 11
  • 2
    Probably the .Net connector version doesn't understand `caching_sha2_password` that is probably being used for the authentication. See [php example](https://stackoverflow.com/questions/52864853/how-to-get-mysql-8-to-run-with-laravel/52865317#52865317) for how to downgrade to previous authentication or alternately try the newer .Net connector. – danblack Jun 03 '19 at 22:43
  • ```` | user | host | plugin | +---------------+-----------+-----------------------+ | amine.mchayaa | localhost | mysql_native_password | ```` the plugin is already set to mysql_native_password and I granted the user all privileges, checked the privileges table already. – Amine Mchayaa Jun 04 '19 at 10:29
  • So user is `amine.mchayaa`? Its probably something basic. Check gain very carefully. Try start using SQL functions like `SHOW CREATE USER` rather than probing tables directly. If still stuck include more info like exact error, `SHOW CREATE USER` info. user@localhost and user@% are different users too. – danblack Jun 04 '19 at 18:31

0 Answers0