Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save I82Much/953762 to your computer and use it in GitHub Desktop.
Save I82Much/953762 to your computer and use it in GitHub Desktop.
MySQL NHibernate Mono Configuration
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<!-- an ISessionFactory instance -->
<session-factory>
<!-- properties -->
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="connection.driver_class">
NHibernate.Driver.MySqlDataDriver
</property>
<property name="connection.connection_string">
<!-- Found from http://www.connectionstrings.com/mysql; note that the 'dev' and 'test_password'
match the user we created, and 'products' matches the Database -->
Server=localhost;Database=products;Uid=dev;Pwd=test_password;
</property>
<!-- Will automatically create a fresh table each time we create an ISessionFactory object -->
<property name="hbm2ddl.auto">create-drop</property>
<property name="dialect">
NHibernate.Dialect.MySQLDialect
</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment