title: Nhibernate for MySQL8 .NET Framework 4
body: <p>I'm currently setting up a project in .NET Framework 4 with Nhibernate and MySQL 8 as my DB.</p>
  
  <p>I can't seem to know where have I gone wrong but I'm guessing its because of the dialect in my <strong>hibernate.cfg.xml</strong> that it does not return anything back.</p>
  
  <p>I want to know if these line is correct from my config xml for MySQL8</p>
  
  <pre><code>&lt;property name="dialect"&gt;NHibernate.Dialect.MySQLDialect&lt;/property&gt;
  &lt;property name="connection.driver_class"&gt;NHibernate.Driver.MySqlDataDriver&lt;/property&gt;
  </code></pre>
  
  <p>The Code I want to run:</p>
  
  <pre><code>MyConfig = new Configuration();
          MyConfig.Configure();
          MyConfig.AddAssembly(typeof(Users).Assembly);
          MySessionFactory = MyConfig.BuildSessionFactory();
          MySession = MySessionFactory.OpenSession();
          using (MySession)
          {
              int id = 1;
              Users user = MySession.CreateCriteria(typeof(Users))
                                    .Add(Restrictions.Eq("UserId", id))
                                    .UniqueResult&lt;Users&gt;();
              Console.WriteLine($"Get {user}");
          }
  </code></pre>
  
  <p>The Users.hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                     assembly="My"
                     namespace="My.Domain"&gt;
      &lt;class name="Users"&gt;
          &lt;id name="UserId"&gt;
              &lt;generator class="native"&gt;&lt;/generator&gt;
          &lt;/id&gt;
          &lt;property name ="Username" /&gt;
          &lt;property name ="FirstName" /&gt;
          &lt;property name ="LastName" /&gt;
          &lt;property name ="Status" /&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>