-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Getting MySql Running
PostPosted: Mon Jun 20, 2005 1:24 pm 
Hi there,

I'm in the throws of converting an MSSQL project to MySQL, and wanted to switch over my NHibernate configuration files. I'm getting the following error when I try to run my tests (note that DataAccess.NHSession is just a simple "helper" class, it's not been any trouble so far):

Code:
NMI.UnitTests.NHibernateDataAccessTests.TestSetup : System.TypeInitializationException : The type initializer for "NMI.Utility.DataAccess.NHSession" threw an exception.
  ----> NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.MySqlDataDriver.
  ----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
  ----> NHibernate.HibernateException : The IDbCommand and IDbConnection implementation in the Assembly MySql.Data could not be found.  Please ensure that the Assemblies MySql.Data.dll and ICSharpCode.SharpZipLib.dll are in the Global Assembly Cache or in a location that NHibernate can use System.Type.GetType(string) to load the types from.


The steps I've taken are:

- Updated project to use latest NHibernate release (0.8.4)
- Downloaded the ByteFX drivers from http://sourceforge.net/projects/mysqlnet/
- Downloaded the latest SharpZipLib

Referenced all these from my project (not sure if this is needed).

I've also updated my config files to have the following settings

Code:
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
      <add key="hibernate.dialect" value="NHibernate.Dialect.MySQLDialect" />
      <add key="hibernate.connection.driver_class" value="NHibernate.Driver.MySqlDataDriver" />
      <add key="hibernate.connection.connection_string" value="server=(local); user id=root; password=xxxxx; database=nmi_indexer; pooling=false;" />


Is there anything I'm missing here?

Any help much appreciated.

Tobin

P.S - I also scanned the docs, examples and FAQ for any MySql examples. Didn't see any in there.


Top
  
 
 Post subject:
PostPosted: Mon Jun 20, 2005 6:09 pm 
Senior
Senior

Joined: Sat May 14, 2005 8:40 am
Posts: 130
You need MySQL .NET connector instead of the ByteFX drivers. Download available at http://dev.mysql.com/downloads/connector/net/1.0.html .

_________________
Cuyahoga


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 4:04 am 
Aha! Thank you.


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.