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.  [ 4 posts ] 
Author Message
 Post subject: Error connecting mysql - help required
PostPosted: Thu Aug 31, 2006 8:10 am 
Beginner
Beginner

Joined: Wed Aug 30, 2006 2:06 am
Posts: 24
I am trying to connect mysql from nhibernate. I am using Visual Stido 2003.

I am getting the below error.
Additional information: Could not create the driver from NHibernate.Driver.MySqlDataDriver.

My hibernate.cfg.xml is as follows.

<?xml version="1.0" encoding="UTF-8"?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.0" >
<session-factory>
<property name="dialect">NHibernate.Dialect.MySQLDialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnection
Provider</property>
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver
</property>
<property name="connection.connection_string">Server=xxxxx;initial catalog=test;Integrated Security=false;UID=root;PWD=xxxx</property>
<mapping file="C:\Vijay\tryOr\Customer\Cust.hbm.xml" />
<mapping assembly="Customer" />
</session-factory>
</hibernate-configuration>

can some one help me to resolve this?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 9:27 am 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
Hello.

I think your connection string isn't right.

I use something like this (in web.config):

Code:
<!-- NHibernate Configuration -->
<nhibernate>
   <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="Database=xxxx;Data Source=yyyy;Port=zzzz;User Id=kkkk;Password=nnnn"/>
</nhibernate>


Top
 Profile  
 
 Post subject: Error connecting mysql - help required
PostPosted: Fri Sep 01, 2006 1:11 am 
Beginner
Beginner

Joined: Wed Aug 30, 2006 2:06 am
Posts: 24
I am trying with a console application to connect to the mysql server.
I tried changing the config to the one given but didn't work.

Can some one let me know how the hibernate.cfg.xml config should be for connecting the mysql server?

Thanks


Top
 Profile  
 
 Post subject: Error connecting mysql - help required
PostPosted: Wed Sep 06, 2006 4:48 am 
Newbie

Joined: Wed Aug 17, 2005 6:25 am
Posts: 4
the NHibernate.Driver.MySqlDataDriver uses mysql.data.dll, copy mysql.data.dll to your executable directory. As far as i can recall it uses version 1.04 of mysql.data.dll. u can download the mysql connector from mysql website, if u dont have it


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.