Created By
DMG Development
As Seen On

Main Page  |  Forums  |  Register  |  Active Topics  |  Members  |  Search

 
Username:
Password:
DMG Forums >> DMG Forums Discussion >> Tutorials & HOWTO Articles >> Installing & Using MySQL With DMG Forums
Installing & Using MySQL With DMG Forums
Author Topic
grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 6/15/2007 3:04:10 PM

Beginning with DMG Forums 3.1, MySQL is an officially supported database server that can be used with the application. The instructions in this tutorial will help you install MySQL and set up DMG Forums to use it for the application's database backend.
grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 6/15/2007 3:04:30 PM

MySQL Setup

Before installing MySQL or DMG Forums, be sure that the latest version of IIS is installed and the Microsoft .NET Framework 2.0 is installed. After these two items are on the machine, follow the steps below to install MySQL. It is recommended that you use MySQL 5.0 or higher. Also, it is recommended to use the 5.1 ODBC Connector, which now includes unicode support.



Installing MySQL

1. The latest version of MySQL can be downloaded from this location.

2. Once the file is downloaded to a location on the computer that you wish to install on, unzip the files and run the setup executable to begin the installation. Follow the prompts to install MySQL with the configuration options that you need. For help with installation options, visit the MySQL website.

3. Be sure to configure the database server to run as a Windows service.

4. When the setup asks for you to enter a root password, be sure to enter something that you will remember. The root password will be required for installing DMG Forums.



Installing MySQL Connector/ODBC 5.1

1. DMG Forums requires an ODBC connector to be installed on the database server in order to connect. To download the ODBC 5.1 driver, click here.

2. Once the file is downloaded, run the MSI to begin the installation. Follow the prompts and install with the default options.



Installing MySQL GUI Tools

1. The GUI tools provide you a graphical interface for managing your MySQL database server. These tools will be useful when setting up user accounts to access the DMG Forums database. To download the GUI tools, click here.

2. Once the file is downloaded, run the MSI to begin the installation. Follow the prompts and install with the default options.

3. After installation, go to Start Menu -> Programs -> MySQL -> MySQL Administrator. When the login dialog appears as shown in the picture below, type "localhost" for the server host and type "root" as the username. Enter the root password that you created during the MySQL setup.



4. Inside MySQL Administrator, click "Catalogs." Right-click in the catalogs box as shown in the picture below and click "Create New Schema." Give the schema (database) a name.



5. The root account will be used to set up DMG Forums, but a separate user with less rights must be created to run the application. To do this, click the "User Administration" button. When the user admin screen appears, click the "Add new user" button at the bottom. Provide a username and a password that you will remember. Before saving the new user, click the "Schema Privileges" tab and assign the SELECT, INSERT, UPDATE, DELETE, and EXECUTE privileges for this user to the DMG Forums schema that you created in step 4. The screenshot below demonstrates this process.



6. Click "Apply changes" to save the user account. The database setup is now complete. It is time to install DMG Forums.



Installing DMG Forums

1. Download the latest version of DMG Forums (3.2 or above) and install it to a virtual directory on your server such as C:\inetpub\wwwroot\dmgforums. Make sure this directory is set up as an ASP.Net application in IIS.

2. Open the file web.config and comment out the SQL Server connection string line. Uncomment the MySQL ODBC connection string line and uncomment the DatabaseType value. Make sure DatabaseType is set to "MySQL"

3. Set the value of the DatabaseString line to "DRIVER={MySQL ODBC 5.1 Driver};SERVER=YOUR_SERVER;DATABASE=YOUR_DATABASE;UID=YOUR_USERNAME;PASSWORD=YOUR_PASSWORD;OPTION=3;" where YOUR_SERVER is the name of the computer, YOUR_DATABASE is the name of the schema that you created with MySQL Administrator, YOUR_USERNAME is root, and YOUR_PASSWORD is the root password for your MySQL server.

4. In a web browser open the file http://SERVERNAME/YourWebSite/INSTALL/setup.aspx and fill in the details for your installation. Be sure to remember the admin username and password. When all details are entered press Submit to install the forums.

5. After the confirmation screen appears, open web.config and change the UID to the non-root username that you created in the MySQL Administrator tool and change the password to this account's password. Click the button that takes you to the default page and your forums should be up and running.

6. Be sure to delete the /INSTALL directory, the /SOURCE directory, and /bin/setup.dll from your web site after the installation is complete.
adrahn55


Beginner


Join Date: 11/9/2007
Posts: 21
Location: Seattle, WA

Posted: 11/24/2007 8:04:05 AM

Thanks grimmeissen this worked great! I would also like to say you are doing a great job with the coding. It's so clean and organized.

adrahn55


Beginner


Join Date: 11/9/2007
Posts: 21
Location: Seattle, WA

Posted: 12/7/2007 11:06:09 PM

A suggestion for you that are running your database on your development machine (localhost):

Uncheck the "Enable Strict Mode" checkbox when you run the Configuration Wizard. I had a problem with deleting replies and topics because of it. The database kept bombing out with the message "Incorrect datetime value" until I disabled that mode with MySQL Administrator.

It is not a issue for me with my hosting provider because they have no restrictive modes set.
grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 12/8/2007 1:02:00 PM

Thanks for the update on the date issues adrahn.
benarjeeprasad


Newbie

Join Date: 10/22/2008
Posts: 2

Posted: 10/22/2008 12:02:10 PM

Dear Grimmeissen up to insallation on Localhost is working good. But could you please let me know how to Upload it to my website? How can i Connect the DB also to my website???? Please let me know..

grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 10/23/2008 7:12:02 PM

If everything is working on your local machine, then the setup should be no different on your web server. If you have purchased shared hosting, you will need to make sure that they provide MySQL database service. And if so, they will probably have some web-based tool to manage it rather than having access to the admin GUI.
Cap


Newbie


Join Date: 12/28/2008
Posts: 7
Location: Zagreb, Croatia

Posted: 12/28/2008 1:28:49 PM

Hello all,
I'am trying to setup this on my home server but I always geting this error:

ERROR: There was a SQL error during setup. View the error message below and then Click Here to try again.

System.Data.Odbc.OdbcException: ERROR [42S02] [MySQL][ODBC 5.1 Driver][mysqld-5.1.30-community]Table 'dmg.sysobjects' doesn't exist at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior) at DMGForums.Global.Database.Read(String strSql, Int32 Rows) at DMGForums.Setup.SQLSetup.Page_Load(Object sender, EventArgs e)

It's say that "Table 'dmg.sysobjects' doesn't exist" but I thought that he must be created with setup procedure.
Em I missing something?

Please help.

grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 12/29/2008 8:16:03 AM

There is already a topic answering Cap's question, but I'll include it here as well in case any others have the same problem.

He got the error because he forgot to uncomment the MySQL sections in web.config.
armada4x4


Newbie

Join Date: 4/24/2009
Posts: 1

Posted: 4/24/2009 7:53:14 AM

Thank you grimmeissen for the instruction. I am so close to get the forum running but I ran into a problem. When I access "http://SERVERNAME/YourWebSite/INSTALL/setup.aspx" (my server ofcourse) I get the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The XML file c:\inetpub\wwwroot\forum\web.config could not be loaded. Access to the path "c:\inetpub\wwwroot\forum\web.config" is denied.
Source Error:
[No relevant source lines]
Source File: c:\inetpub\wwwroot\forum\web.config Line: 0

I follow your instruction carefully to edit the web.config although I am not 100% clear on #2

This is my web.config file

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<compilation defaultLanguage="VB" debug="false" />
<pages validateRequest="false" />
</system.web>

<appSettings>
<add key="DatabaseString" value="Driver={SQL Server};Server=forumserver;Database=database;Uid=root;Pwd=12345;" />
<!-- Comment the SQL connection string and uncomment the two lines below for MySQL -->
<!-- <add key="DatabaseString" value="DRIVER={MySQL ODBC 5.1 Driver};SERVER=forumserver;DATABASE=database;UID=root;PASSWORD=12345;OPTION=3;" /> -->
<!-- <add key="DatabaseType" value="MySQL" /> -->
<add key="DatabasePrefix" value="DMG" />
<add key="LongDateFormat" value="MMMM d, yyyy" />
<add key="ShortDateFormat" value="M/d/yyyy" />
<add key="DateTimeFormat" value="M/d/yyyy h:mm:ss tt" />
</appSettings>

</configuration>

Please help me figure out what I am doing wrong. Thank you for your time.

grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 4/24/2009 9:54:10 AM

I'm not sure why you're getting access denied on web.config, that's a whole different problem in and of itself that might need to go to another thread.

But as for the web.config changes you need to make in order to get MySQL running, what you want to do is completely remove the following line from web.config.

Code:
<add key="DatabaseString" value="Driver={SQL Server};Server=forumserver;Database=database;Uid=root;Pwd=12345;" />


Then, remove the comments ("<!-- -->") from the 2nd and 3rd line below, so your web.config looks like this.

Code:
<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<compilation defaultLanguage="VB" debug="false" />
<pages validateRequest="false" />
</system.web>

<appSettings>
<add key="DatabaseString" value="DRIVER={MySQL ODBC 5.1 Driver};SERVER=forumserver;DATABASE=database;UID=root;PASSWORD=12345;OPTION=3;" />
<add key="DatabaseType" value="MySQL" />
<add key="DatabasePrefix" value="DMG" />
<add key="LongDateFormat" value="MMMM d, yyyy" />
<add key="ShortDateFormat" value="M/d/yyyy" />
<add key="DateTimeFormat" value="M/d/yyyy h:mm:ss tt" />
</appSettings>

</configuration>

  Copyright DMG Development DMG Forums 3.2