Skip to content

Grassroots + MySQL

JasonOffutt edited this page Jan 6, 2012 · 12 revisions

Grassroots with MySQL

In order to get Grassroots working with a MySQL database you'll need to do the following steps:

  • Download and install MySQL 5.1 or greater.
  • Run the database create and seed scripts found under setup/scripts/MySQL.
  • Run the Stored Procedure create scripts found in setup/StoredProcedures/MySQL.
  • Ensure your Grassroots source is referencing the MySQL .NET provider, MySQL.Data.dll, MySQL.Data.Entities and MySQL.Web should appear in the bin folder. This enables Entity Framework to talk to MySQL.
  • Uncomment the MySQL connection string in the Grassroots web.config file. Make sure to edit it with the appropriate username and password for your MySQL server account. Note: Make sure your database name is all lower case and update with the appropriate server/database name and credentials.
<add name="GrassrootsContext" connectionString="Server=localhost; Database=grassroots; Uid=grassrootsuser; Pwd=secret;" providerName="MySql.Data.MySqlClient" />
  • Uncomment the system.data config section in web.config.
<system.data>
    <DbProviderFactories>
      <clear />
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
</system.data>
  • Uncomment the MySQL Elmah errorLog configuration setting in the elmah configuration section in web.config.
<errorLog type="Elmah.MySqlErrorLog, Elmah" connectionStringName="GrassrootsContext" />

Clone this wiki locally