Database Manager - Unusual Setups
This document contains miscellaneous tips and tricks to get a database to work in an unusual situation. This includes situations where the database resides on a server other than the one that hosts your board, and in situations where you are on a Windows system with a buggy implementation of the DBI/DBD::mysql modules.
MySQL on server other than web server
For most users, the MySQL database server will reside on the same machine as the web server. This allows the most efficient data transfer between the database and the Discus applications, as there is no need to transfer this data over a network.
However, there are cases where the MySQL server has been installed onto a different machine than the web server. Fortunately, the DBI module and Discus can accommodate this situation. You need to do the following:
Determine the IP address or host name: If you do not know this information, ask your web host. For the purposes of the remainder of this section, we will assume your MySQL database is found at mysql.yourdomain.com (note that an actual host name or an IP address will work equally well in this step).
Determine your database name: When you set up your MySQL database, a database name was determined. In the instructions, this was called database_name, and for consistency, we will assume your MySQL database is called database_name.
Go to the Database Manager and click the Setup tab.
Enter the database name: Use the following format:
database_name;host=mysql.yourdomain.com
Note that you typed the database name, then a semicolon, then the text "host=" without the quotes, and finally the server name or IP address of the server that hosts your MySQL database. Note also that there are NO SPACES anywhere on the line that you typed. Substitute in the actual database name and MySQL host in your entry.
Configure other MySQL connection parameters: Give the username and password, if any, needed to connect to the MySQL database. You may use an optional prefix as noted in the instructions to set up your MySQL database. Leave the "Optional Socket:" setting blank.
Save your settings: If you did it correctly, you should see a status message indicating that a connection was made to your MySQL database.
Internal Server Error only when connection parameters are correct
DiscusWare has received occasional reports of an Internal Server Error that occurs when all of the following conditions are met:
- Board is installed on a Windows server.
- Database name, username, and password are all correct.
- DBI and DBD::mysql modules are installed.
Generally, you were able to go to the Setup tab without a problem and enter your database name and other connection information. However, when you saved your information, you got an Internal Server Error. And now every time you go to the Database Manager you get an Internal Server Error.
If this describes your problem, you are unfortunate enough to have a buggy distribution of the MySQL DBD module. This bug is well-known (see http://bugzilla.mozilla.org/show_bug.cgi?id=100259 if you are interested in the tracking history).
The workaround involes modifying the Perl module to correct the bug. This can be done only by the Windows server administrator. THE FOLLOWING PROCEDURE IS NOT SUPPORTED BY DISCUSWARE.
Find your Perl installation (typically c:\perl) and navigate to the directory that contains the module (\site\lib\DBD under the Perl tree).
Open the Sponge.pm file in a text editor (like Notepad or Ultra Edit).
Replace this defective code:
my $numFields;
if ($attribs->{'NUM_OF_FIELDS'}) {
$numFields = $attribs->{'NUM_OF_FIELDS'};
} elsif ($attribs->{'NAME'}) {
$numFields = @{$attribs->{NAME}};
with the following corrected code:
my $numFields;
if ($attribs->{'NUM_OF_FIELDS'}) {
$numFields = $attribs->{'NUM_OF_FIELDS'};
} elsif ($attribs->{'NAMES'}) {
$numFields = @{$attribs->{NAMES}};
Note that you added an "S" to "NAME" in the last two lines. Save the file.
Return to your Database Manager. The interface should now load properly with an indication that a connection was successfully initiated to the database.
Copyright © 2002, DiscusWare, LLC, all rights reserved