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>