NHibernate出现could not execute query问题

时间:2024-01-03 21:03:50

今天在调试代码时工程总报错,提示could not execute query xxxxxxxxxxxxxxxxxxxxxxxxxxx

找了很久,最终同事发现是数据库连接配置文件的问题。

  <hibernate-configuration  xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="NHibernate.Test">
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
<property name="connection.connection_string">
Server=192.168.0.2;Database=dbName;User ID=root;Password=123456;</property>
<property name="dialect">NHibernate.Dialect.MySQLDialect</property>
<property name="hbm2ddl.keywords">none</property>
</session-factory>
</hibernate-configuration>

  将Password写成123了,实际上是123456.