MySQL 5.1 Reference Manual  /  ...  /  Problems Using the Perl DBI/DBD Interface

2.15.3 Problems Using the Perl DBI/DBD Interface

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

  • Copy 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

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

  • Add the path name of the directory where 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'
/usr/bin/perl: can't resolve symbol '__divdi3'

Add -L/usr/lib/gcc-lib/... -lgcc to the link command when the library gets built (check the output from make for when you compile the Perl client). The -L option should specify the path name of the directory where libgcc.a is located on your system.

Another cause of this problem may be that Perl and MySQL are not both compiled with gcc. In this case, you can solve the mismatch by compiling both with gcc.

You may see the following error from DBD::mysql when you run the tests:

t/00base............install_driver(mysql) failed:
Can't load '../blib/arch/auto/DBD/mysql/' for module DBD::mysql:
../blib/arch/auto/DBD/mysql/ undefined symbol:
uncompress at /usr/lib/perl5/5.00503/i586-linux/ line 169.

This means that you need to include the -lz compression library on the link line. That can be done by changing the following line in the file lib/DBD/mysql/

$sysliblist .= " -lm";

Change that line to:

$sysliblist .= " -lm -lz";

After this, you must run make realclean and then proceed with the installation from the beginning.

Download this Manual
User Comments
Sign Up Login You must be logged in to post a comment.