Msql Library for Perl
It seems that each time one installs the Msql libraries for perl,
regardless of which version (Msql.pm, "Mysql," DBD, etc), they all have
an annoying association with a particular database. The build process
compiles in paths to particular libraries. In particular, it compiles
in the path to the msql.conf file. There is no simply way to defeat
The workaround is to have an msql directory and a perl library
directory which are a matched pair. You need one pair of these per
msql daemon you intend to run. In theory, a single daemon can serve
multiple databases. It is not necessary to serve one database per
In point of fact, the msql directory only needs to be separate
enoughto have a separate msql.conf file. The bin, lib, include, and
other directories within it can all be symbolic links to one main
Here's an overview of the process:
- Create an msql directory, with your properly configured msql.conf.
- Build an instance of the Msql perl library which points at that
- Modify your perl script to pull in that particular version of the Msql
- Install msql version 2 which you can get at
Install it in a local directory where you're going to be storing your database
- Get the database up and running. Edit your msql.conf file in
/home/userid/msql to reflect which machine, port, and so on you'll
be using. This is critical.
- Get the sources for the "Msql-Mysql" perl package. Extract them.
To build them correctly, you must do the following:
a. Run "/usr/cs/bin/perl Makefile.PL" in the main directory.
b. Answer several questions. Here they are:
You don't have installed the DBI module, version 0.91 or later. I
cannot continue installing the DBD modules.
You have two options:
Do you want to abort now? [y]
- Abort now, install the DBI module (available at any CPAN mirror, see
'perldoc CPAN') and rerun me. (Recommended)
- Disable installation of the DBD modules and install the non-DBD drivers
Which DBMS do you want to use?
Enter your choice: 
Where is your msql installed? Please tell me the directory that contains the
subdir include/. [/usr/local/Hughes]
c. Run "make". Watch it build.
ANSWER your msql directory (e.g. /home/userid/msql/msql)
- Make a perl directory somewhere in your database area. (e.g. /home/userid/msql/perl)
This will house the perl libraries which correspond to a particular database.
- Copy several files into your perl directory. "/tmp/Mysql" is the location of the perl stuff I
mv auto /home/userid/msql/perl
mv Msql* Mysql* /home/userid/msql/perl
- Edit your script to tell perl to load libraries from that directory. Instead of "require Msql;"
use the following two lines:
- use lib "/home/userid/msql/perl";
- require "/home/userid/msql/perl/Msql.pm";