MySQL 连接器 6.7.4 Entity Framework 5 模型优先

标签 mysql entity-framework-5 connector-net

我正在使用 Visual Studion 2012、MySQL 5.6.14、Connector for .NET 6.7.4 和 Visual Studio 插件 1.0.2

我已经创建了一个 Entity Framework ,但无法使“从模型生成数据库”工作。

我已经尝试过这里建议的修改

http://bugs.mysql.com/bug.php?id=67964

但现在我得到了下面的异常(看起来好像没有通过凭据)。有人经历过吗?

`Error  2   Running transformation: MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host '' for user '' using method 'mysql_native_password' failed with message: Access denied for user ''@'localhost' (using password: NO) ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Access denied for user ''@'localhost' (using password: NO)
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket()
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.AuthenticationFailed(Exception ex)
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket()
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.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at MySql.Data.MySqlClient.MySqlScriptServices.GetTableCreateScript(EntitySet entitySet, String connectionString, String version)
at Microsoft.VisualStudio.TextTemplatingD3E432D0E484C972F42C6D13E94510BEB0C48500C7AACE47A3533033751EF00050B7580D6891ADC8583A2327CA5DD242B2AF4C7A11EB05A80839B23CDA63F07B.GeneratedTextTransformation.TransformText() in c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\SSDLToMySQL.tt:line 133   c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\SSDLToMySQL.tt    133 1`

最佳答案

根据发行说明,您似乎需要连接器 6.8.1。

http://forums.mysql.com/read.php?174,601041,601041#msg-601041

我能够使用较低版本的连接器将脚本生成模板从 SQL 更改为 MySQL(包含在 MySQL for visual studio 插件中)来做到这一点。但是可能会有一些问题。

关于MySQL 连接器 6.7.4 Entity Framework 5 模型优先,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19138450/

相关文章:

mysql - 当此 cfoutput 被分组时,在 cfoutput 的末尾添加逗号

entity-framework-5 - Entity Framework 5 从数据库更新模型不生成表类

c# - 如何使用外键属性的自定义名称映射相关对象,例如 PostId 而不是 Post_Id

c# - 为什么 DELETE 语句在 MySql Workbench 和 PHP/PDO 中运行时会在 MySQL Connector/net 中默默失败?

c# - MySQL GRANT 给用户 @'host' 未按预期运行

php - 无需 cron 在后台发送邮件

mysql - 无法创建表。愚蠢的问题,简单的查询

Mysql 两个查询都使用 "Using where & Using temporary",但速度有差异

c# - 是否在 LINQ 中使用 AsEnumerable()?

MySql *完全随机* 无法连接到任何指定的 MySQL 主机