• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7267
  • Last Modified:

Unable to install DBD::mysql perl package on Ubuntu

I am trying to install perl's DBD::mysql package with cpan > install DBD::mysql, after successfully installing mysql in an Ubuntu machine, but cpan barks complaining about "mysql_config", a file that that seems missing, and the installation is aborted with the messages:
--------------------------------------------------------------
Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
not contain the path to mysql_config. Resorting to guessed values!
Can't exec "mysql_config": No existe el fichero ó directorio at Makefile.PL line 466.
                (file or directory does not exist at Makefile.PL line 486)
Can't exec "mysql_config": No existe el fichero ó directorio at Makefile.PL line 466.
Can't exec "mysql_config": No existe el fichero ó directorio at Makefile.PL line 466.
Can't exec "mysql_config": No existe el fichero ó directorio at Makefile.PL line 466.
Can't exec "mysql_config": No existe el fichero ó directorio at Makefile.PL line 466.
Can't exec "mysql_config": No existe el fichero ó directorio at Makefile.PL line 466.
Failed to determine directory of mysql.h. Use

  perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

  perl Makefile.PL --help
Running make test
  Make had some problems, maybe interrupted? Won't test
Running make install
  Make had some problems, maybe interrupted? Won't install
Bundle summary: The following items in bundle Bundle::DBD::mysql had
installation problems:
  DBI DBD::mysql
--------------------------------------------------------------

Apparently, "mysql_config" should have been previously created by another package, because it does not exist in any place (locate mysql_config yields 0 results). The process should be as simple as typing install DBD::mysql in cpan, but some piece seems to be missing. Any hint?

DBI was successfully installed, though.

0
innovideo
Asked:
innovideo
  • 2
1 Solution
 
hernst42Commented:
You need to install the development-tools of mysql to create those perl-files.
As root execute something like:
apt-get install libmysqlclient12-dev libmysqlclient12
0
 
innovideoAuthor Commented:
You are great! Your solution worked, although I needed to replace the version with a later one, namely:

    apt-get install libmysqlclient15-dev

Also, version 15 already contains the second package (libmysqlclient), therefore only the dev package is required to be installed.

This was my first question as a trial user, but your reply convinced me to confirm the subscription. This answer is worth a subscription. Many thanks!
0
 
innovideoAuthor Commented:
You are great! Your solution worked, although I needed to replace the version with a later one, namely:

    apt-get install libmysqlclient15-dev

Also, version 15 already contains the second package (libmysqlclient), therefore only the dev package is required to be installed.

This was my first question as a trial user, but your reply convinced me to confirm the subscription. This answer is worth a subscription. Many thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now