Bug #28419 Can't install DBD::mysql from CPAN
Submitted: 14 May 2007 16:01 Modified: 20 Feb 2013 22:39
Reporter: Christopher Beland Email Updates:
Status: Unsupported Impact on me:
None 
Category:Connectors: DBD::mysql ( Perl ) Severity:S3 (Non-critical)
Version:4.004 OS:Linux
Assigned to: CPU Architecture:Any

[14 May 2007 16:01] Christopher Beland
Description:
I am having trouble installing DBD::mysql on several machines.  The output I will attach is from attempting to do this on a 32-bit Fedora 6 laptop.  I also see the problem on a 64-bit centos-release-5-0.0.el5.centos.2 server, but not a 32-bit centos-release-4-4.2 server.  There may be other configuration differences which make or break the install, but I'm not sure what they would be.

How to repeat:
Type "install DBD::mysql" at the CPAN prompt.
[14 May 2007 16:04] Christopher Beland
Output from attempted install on Fedora 6

Attachment: mysql-bug.txt (text/plain), 34.92 KiB.

[15 May 2007 3:58] Valeriy Kravchuk
Thank you for a problem report. What exact version and binaries of MySQL server/client/shared libraries you had used?

Please, send the results of:

find / -name mysql.h -print 2>/dev/null

from your system. Installation problems started with inability to find that file.
[15 May 2007 15:53] Christopher Beland
The MySQL RPMs which were installed are:

mysql-5.0.27-1.fc6
mysql-server-5.0.27-1.fc6

The output of:
 find / -name mysql.h -print 2>/dev/null
was an error:
 find: paths must precede expression
 Usage: find [-H] [-L] [-P] [path...] [expression]

However, using the "locate" command reveals that the file mysql.h was not present on the system.  This file is in the mysql-devel RPM, which was not installed, and which has not so far been needed to use MySQL and DBD::mysql.

I was able to successfully install DBD::mysql by installing the mysql-devel RPM and running "CREATE DATABASE test;" to satisfy the module's tests.  The machine that successfully installed on the first attempt already had mysql-devel installed.

If there is a way to give a clear error message that libraries needed for compilation are missing, rather than several pages of confusing warnings and errors, that would be very helpful.
[17 May 2007 8:15] Sveta Smirnova
Thank you for the feedback.

But there is next message in the provided error log file:

In file included from dbdimp.c:20:
dbdimp.h:22:49: error: mysql.h: No such file or directory
dbdimp.h:23:45: error: mysqld_error.h: No such file or directory
dbdimp.h:24:49: error: errmsg.h: No such file or directory

Is this not enough to clarify the problem?
[17 May 2007 12:04] Christopher Beland
If the message had been clear, I would have downloaded the needed library instead of filing a bug.

The most prominent part of the error message is the last page, not the beginning of where things went awry.  It's actually not trivial to find the point at which things are actually malfunctioning; there is a lot of output before the point which mentions the missing header files, not all of which looks happy.

There's also no particular reason to expect random Perl programmers to even know what a .h file is, much less what is causing the module to report it missing.  It could be that someone has set some compiler flag wrong, or who knows what.
[17 May 2007 20:20] Sveta Smirnova
Thank you for the feedback.

I'll mark the report as "Verified", but change severity to S3 as this is just cosmetic issue.
[11 Aug 2007 20:23] none noname
error report file

Attachment: error.txt (text/plain), 29.94 KiB.

[11 Aug 2007 20:41] none noname
dbd::mysql bug on PCBSD-1.3.01-x86 with PAMP 5.0 pbi, seems to be a mysql 5 bug, fix may be to use mysql 4.1

Attachment: error.txt (text/plain), 29.94 KiB.

[5 Mar 2008 1:14] Stefano C
I found the answer in another forum.
mysql.h is included in the mysql-devel package which is not installed by default on my installations.  Installing mysql-devel fixed the problem for me.
[20 Feb 2013 22:39] Sveta Smirnova
Thank you for the report.

We don't work on DBD::mysql bugs anymore. All its bugs should go to CPAN: https://rt.cpan.org/Public/Dist/Display.html?Name=DBD-mysql

And, according to last comment, this can be not a bug at all.