WDBI MySQL Interface

The mysql_dbi.pl file makes it possible to use WDBI to interface to MySQL.

MySQL is available from http://www.tcx.se/.

Requirements

You need Perl version 5.004 or later. Both the DBD::MySQL and MsqlPerl extensions are combined into the Mysql-modules. You will need to use the DBD extension.

You can find information about Perl at: http://www.perl.com.

You can find out more about DBI and the DBD modules at: http://www.hermetica.com/technologia/perl/DBI/index.html.

Configuration of WDBI

Follow the normal WDBI configuration instructions, with the following exceptions :

Configuration of MySQL User Privileges

In order for WDBI to access a MySQL database from the Web, you must tell MySQL it's okay to let your Web server use the database. Depending on your version of MySQL, the user 'nobody' is probably already allowed from 'localhost', but here's how to do it in case your setup is different.

On my system, a piece of wdbi.conf looks like so:

   $USER          = "nobody";     # Database user.
   $PSWD          = "";           # Password for database user.
   $SERVER        = "localhost";  # Database server.  Change this. :)
Once I set these values, I have to add them to MySQL's user privilege tables. To give the user 'nobody' the database privileges of select, insert, update, and delete ONLY, enter the mysql monitor and type:
insert into user values ('localhost', 'nobody', '', 'Y','Y','Y','Y','N','N','N','N','N','N')\g

NOTES:

  1. The value of $USER entered in wdbi_conf.pm need not correspond to the username of the account your Web server runs under. As long as you specify a legitimate username and password, MySQL will give you database access.
  2. The example above uses no password. You may choose to specify a password in both the user table and wdbi_conf.pm.
  3. It is possible to further restrict user privileges on a database by database basis by using MySQL's 'db' and 'host' tables. This is more trouble, but also more secure.

Creating FDF's

Included is also a MySQL version of mkfdf, called mysqlfdf, which will produce a working template FDF file given a database and table name.

Copyright © 1998 Jeff Rowe