Visual Studio Connection to Mysql has broken
Visual Studio Connection to Mysql has broken
I have been using Mysql with entity framework for a long time now. I have had the current server installed on my machine for a number of years without issue (apart from the stupid mysql nuget packages never working...) However I have suddenly got a big issue. When I try to connect to create a new model via the entity framework wizard I get the following error message
Authentication to host '' for user '' using method
'mysql-native-password' failed with message: Access denied for user
''@'192.168.xxx.xxx' (using password: NO)
I can cancel that message and carry on trying to create a new connection however I then get the message
The given key was not present in the dictionary
This happens for every project I have, even ones that were working fine a few days ago...
How on earth do I fix this?
Update
I have uninstalled mysql server and all related tools completely. Then reinstalled them. I now do not get the same error at first. So now instead of the "Authentication to host" error I get
Missing Server and User in Credentials
I still get the second error the same as before. So it seems it must be something to do with visual studio rather than MySql... I might try to uninstall that now.
Update 2
Okay. I have now reinstalled VS 2017 and I no longer get the errors. However I am now back to getting the "Your Project References the latest version of entity framework error". I have had this many times over the years as Oracle seems totally unable to provide working nuget packages. So normally I would copy the dlls from the connector installation to my project and make some changes to my app.config and all would work fine. However I no longer am able to get everything working using this method.
I am using connector 8.0.12.0
and this is my app.config
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Possible duplicate of Entity Framework. Your Project References the latest version of entity framework error VS2017 MYSQL 8.0.12
– Bradley Grainger
Sep 9 '18 at 1:42