-->
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.  [ 2 posts ] 
Author Message
 Post subject: NHibernate MySql connectionstring
PostPosted: Fri Jun 10, 2005 6:39 pm 
Hi,

I'am using the newest Connector/NET (formerly ByteFX.Data.MySqlClient).
It seems like i have a problem with the connection string since there is _ (underscore) in username and database.
Can this be true?

My connectionstring
Code:
<add key="hibernate.connection.connection_string" value="server=mysql1.unoeuro.com; user id=lukka_dk; password=XXXXX; database=lukka_dk_db; pooling=false;" />


When I try use NHibernate I get this error:
Quote:
Access denied for user: 'lukka_dk@%' to database 'dbo'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: MySql.Data.MySqlClient.MySqlException: Access denied for user: 'lukka_dk@%' to database 'dbo'


This work fine, so username and password are right, and I can connect to the database
Code:
MySqlConnection conn = new MySqlConnection("server=mysql1.unoeuro.com; user id=lukka_dk; password=XXXXX; database=lukka_dk_db; pooling=false;");
         MySqlCommand command = new MySqlCommand();
         command.CommandType = CommandType.Text;
         command.CommandText = "INSERT INTO Pictures (title) VALUES('teasd')";
         command.Connection = conn;
         conn.Open();
         command.ExecuteNonQuery();
         conn.Close();


This is in my web.config
Code:
<configSections>
      <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   </configSections>
   <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="server=mysql1.unoeuro.com; user id=lukka_dk; password=XXXXX; database=lukka_dk_db; pooling=false;" />
   </nhibernate>


Top
  
 
 Post subject: Re: NHibernate MySql connectionstring
PostPosted: Sat Jun 11, 2005 5:44 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
grafixdk wrote:
My connectionstring
Code:
<add key="hibernate.connection.connection_string" value="server=mysql1.unoeuro.com; user id=lukka_dk; password=XXXXX; database=lukka_dk_db; pooling=false;" />


When I try use NHibernate I get this error:
Quote:
Access denied for user: 'lukka_dk@%' to database 'dbo'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: MySql.Data.MySqlClient.MySqlException: Access denied for user: 'lukka_dk@%' to database 'dbo'


Are you sure that's the actual connection string that is used? The message refers to database 'dbo' and you have specified database=lukka_dk_db.


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