Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

Authentication works and fails in the same code (no replies)

$
0
0
Hi,

I'm trying the parking example:

https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html

I copy-paste the code, only change port and password.

This works:

using (Parking contextDB = new Parking(connection, false))
{
contextDB.Database.CreateIfNotExists();
}

Even created the database and table.

But this:

context.Cars.AddRange(cars);

thrown this exception:

Authentication to host 'localhost' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'localhost' (using password: NO)

How can be an authentication error if the same connection was able to create the database and table?

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>