## 2.13.2 Installing ActiveState Perl on Windows 

On Windows, you should do the following to install the MySQL DBD  module with ActiveState Perl: 

1. Get ActiveState Perl from http://www.activestate.com/Products/ActivePerl/ and install it. 

2. Open a console window. 

3. If necessary, set the HTTP_proxy  variable. For example, you might try a setting like this: 

C:\> set HTTP_proxy=my.proxy.com:3128 

4. Start the PPM program: 

C:\> C:\perl\bin\ppm.pl 

5. If you have not previously done so, install DBI : 

ppm> install DBI 

6. If this succeeds, run the following command: 

ppm> install DBD-mysql 

This procedure should work with ActiveState Perl 5.6 or higher. 

If you cannot get the procedure to work, you should install the ODBC driver instead and connect to the MySQL server through ODBC: 

## 2.13.3 Problems Using the Perl DBI/DBD Interface 

use DBI; $dbh= DBI->connect("DBI:ODBC:$dsn",$user,$password) || die "Got error $DBI::errstr when connecting to $dsn
"; 

If Perl reports that it cannot find the ../mysql/mysql.so  module, the problem is probably that Perl cannot locate the libmysqlclient.so  shared library. You should be able to fix this problem by one of the following methods: 

•Copy libmysqlclient.so  to the directory where your other shared libraries are located (probably usr/lib  or /lib ). 

•Modify the -L  options used to compile DBD::mysql  to reflect the actual location of libmysqlclient.so . 

•On Linux, you can add the path name of the directory where libmysqlclient.so  is located to the etc/ld.so.conf  file. 

• Add the path name of the directory where libmysqlclient.so  is located to the LD_RUN_PATH environment variable. Some systems use LD_LIBRARY_PATH  instead. 

Note that you may also need to modify the -L  options if there are other libraries that the linker fails to find. For example, if the linker cannot find libc  because it is in /lib  and the link command specifies -L/usr/ lib , change the -L  option to -L/lib  or add -L/lib  to the existing link command. 

If you get the following errors from DBD::mysql , you are probably using gcc  (or using an old binary compiled with gcc ): 

/usr/bin/perl: can’t resolve symbol ’__moddi3’ 

