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.

innovideoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.