-1

大家好,我正在使用 Fluent NHibernate 和 MySQL,但我无法真正访问数据库,我在配置中遇到错误

private static ISessionFactory CreateSessionFactory()
{
    var mysqlconf = MySQLConfiguration.Standard
        .ConnectionString(c => c.Is("Server=localhost;Database=db;User=root;Password=boot;"));

    return Fluently.Configure().Database(mysqlconf).Mappings(m =>
                                                             m.FluentMappings.AddFromAssemblyOf<Program>()).
        BuildSessionFactory();
}

请帮我配置我的代码以连接到我的数据库

错误 An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

4

1 回答 1

1

我使用 mysql.Net 连接器 6.6.2 修复了 Visual Studio 2012 的连接问题

这是下载链接 http://cdn.mysql.com/Downloads/Connector-Net/mysql-connector-net-6.6.2.msi

于 2012-09-25T23:21:42.757 回答