MySQL: Using FogBugz for Windows With MySQL on Windows
Applies to FogBugz 6 Only
If you intend to use MySQL on Windows with your FogBugz installation, please carefully read every line in this guide. Many headaches are created for users who think they have MySQL working, only to find one month later that, for example, large email attachments are inexplicably failing or Japanese characters aren't showing up correctly.
Some key things will be put in red text below, because many readers of this guide skip over them.
Before you Get Started
- To get FogBugz working with MySQL you have to install MySQL and MyODBC. We do not give instructions on how to setup MySQL or MyODBC and assume you have the knowledge to do so yourself. (We did it in a few minutes and had no problems whatsoever. We recommend using the GUI Tools).
- If you are upgrading from a previous version of FogBugz and switching to MySQL, please install the upgraded FogBugz code against the old database FIRST, log in once (so FogBugz can do the upgrade) and THEN convert your database.
- If you want to migrate your data from MS Access to MySQL, read this guide. If you move from Access to MySQL, to enable full-text searching you need to go into the registry and make sure that fFullTextSearch is set to 1. See:
HKLM\SOFTWARE\Fog Creek Software\FogBugz\[path to fogbugz]\fFullTextSearchOK. - MySQL does not currently support non-western languages! More accurately: Unicode is not supported in MyODBC yet. (Version 3.53 -- now codenamed 5.0 -- is expected to support UTF-8 when it is released).
- FogBugz 6 requires MySQL 4.1 or later, as earlier versions of MySQL do not have the functionality to support certain FogBugz 6 features.
Versions of MySQL That We Have Tested:
- MySQL 4.1.9 running with MyODBC version 3.51
- MySQL 5.0 running with MyODBC version 3.51
Configuring MySQL for FogBugz Use
- If you skip this first step, incoming email will fail.
Find your my.ini file (the configuration file for MySQL). It's normally here:
C:\Program Files\MySQL\MySQL Server 4.1
Search your MySQL my.ini file for this:
max_allowed_packet
If you find it, make sure it says:
max_allowed_packet=32M
If you don't find it, add a line at the bottom of the file that says:
max_allowed_packet=32M
In older MySQL versions it may look like this:
set-variable = max_allowed_packet=32M
If you do not have a high setting for max_allowed_packet incoming email attachments will fail! - Give the FogBugz user account in IIS read/execute permissions to the following files in C:\WINDOWS\SYSTEM32:
myodbc3.dll
myodbc3d.dll
myodbc3S.dll - In certain older versions of MySQL you need to be using the UCS-2 Unicode character set, as opposed to the UTF-8 character set. This is because FogBugz for Windows converts strings to Unicode not UTF-8 before sending to the database. See this article on mysql.com.
- On MySQL version 5.0.25 and later and FogBugz 5.0.19 or FogBugz 6 or later, you will have to configure MySQL with strict mode deselected for FogBugz to work properly.
Create a System DSN
Once MySQL is running, go to:
Windows Start Menu > Settings > Control Panel > Administrative Tools > Data Sources (ODBC)
Make sure you click the System Tab, as shown here:
Create a new MyODBC System DSN named FogBugz.
Do not just try to use a connection string (e.g. ODBC) instead of a System DSN. FogBugz needs this DSN because it handles things like type conversion, needed by VBScript.
You must select the following options:
- "Don't Optimize Column Width"
- "Return Matching Rows"
- "Change BIGINT Columns to INT"
- "Disable Transactions"
Screenshots:
Create the FogBugz Database
If you are not importing your FogBugz trial database:
Create a new empty database in MySQL. We use and recommend MySQL Control Center, these instructions will describe using this tool. You can do everything on the command line if you prefer.
- Expand Databases folder
- Right click on Databases folder, choose New Database, name it Fogbugz
- Double click on the new Fogbugz database
- Click the SQL icon on the menu bar
- Go to File > Open
- Open the mysql.sql file in your accessories folder, e.g. C:\Program Files\FogBugz\accessories\mysql.sql)
- Click the exclamation point icon on the menu bar to run this script
- This file creates the needed tables in your new FogBugz database
If you are importing your FogBugz trial database:
Follow the steps in this guide.
Connect FogBugz to MySQL
- Run FogBugz setup, choosing Access as your database type.
- Log in as Administrator and click on Site (top right). Find the Database settings and change that to ODBC, and just type in the name of the System DSN you created: FogBugz.
If you get an error at this point that says "cannot connect to database" be sure that the permissions for the FogBugz user are set correctly in IIS by following this guide.
If you still get errors, please go back to the top of this guide and read it again. Every time someone encounters a problem with MySQL, we update this guide to better address that problem in the future. It's very comprehensive. Oh, and remember to pay close attention to the parts in red! :)
If you do not get errors, and you are able to log in, FogBugz is now running against the MySQL database! Pat yourself on the back and go have some ice cream. (Note: it will ask you to reinstall your licenses, which you can safely do.)







