Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Error installing DBD::mysql: file DBIXS.h not found

by mboudreau (Acolyte)
on Dec 26, 2020 at 21:02 UTC ( #11125755=perlquestion: print w/replies, xml ) Need Help??

mboudreau has asked for the wisdom of the Perl Monks concerning the following question:

Venerable Perl Monks,

I recently upgraded to macOS Big Sur (11.1) and found, as often happens after a major upgrade, that my Perl DBI scripts no longer work. Usually fixing this is just a matter of reinstalling DBD::mysql, but this time I got an error I haven't seen before.

Here's the CPAN output:

cpan[4]> install DBD::mysql Running install for module 'DBD::mysql' Checksum for /Users/mrb/.cpan/sources/authors/id/D/DV/DVEEDEN/DBD-mysq +l-4.050.tar.gz ok Configuring D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz with Makefile.PL PLEASE NOTE: For 'make test' to run properly, you must ensure that the database user 'root' can connect to your MySQL server and has the proper privileges that these tests require such as 'drop table', 'create table', 'drop procedure', 'create procedure' as well as others. mysql> grant all privileges on test.* to 'root'@'localhost' identified + by 's3kr1t'; You can also optionally set the user to run 'make test' with: perl Makefile.PL --testuser=username I will use the following settings for compiling and testing: cflags (mysql_config) = -I/usr/local/mysql/include embedded (mysql_config) = ldflags (guessed ) = libs (mysql_config) = -L/usr/local/mysql/lib -lmysqlclient mysql_config (guessed ) = mysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 nossl (default ) = 0 testdb (default ) = test testhost (default ) = testpassword (default ) = testport (default ) = testsocket (default ) = testuser (guessed ) = root To change these settings, see 'perl Makefile.PL --help' and 'perldoc DBD::mysql::INSTALL'. Checking if libs are available for compiling... Looks good. Checking if your kit is complete... Looks good Using DBI 1.643 (for perl 5.028002 on darwin-thread-multi-2level) inst +alled in /System/Library/Perl/Extras/5.28/darwin-thread-multi-2level/ +auto/DBI/ Generating a Unix-style Makefile Writing Makefile for DBD::mysql Writing MYMETA.yml and MYMETA.json DVEEDEN/DBD-mysql-4.050.tar.gz /usr/bin/perl Makefile.PL -- OK Running make for D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz cp lib/DBD/ blib/lib/DBD/ cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cp lib/Bundle/DBD/ blib/lib/Bundle/DBD/ cp lib/DBD/mysql/ blib/lib/DBD/mysql/ Running Mkbootstrap for mysql () chmod 644 "" "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- b +lib/arch/auto/DBD/mysql/ 644 cc -c -I/System/Library/Perl/Extras/5.28/darwin-thread-multi-2level/a +uto/DBI -I/usr/local/mysql/include -DDBD_MYSQL_WITH_SSL -g -g -pipe +-fno-strict-aliasing -fstack-protector-strong -DPERL_USE_SAFE_PUTENV +-Os -DVERSION=\"4.050\" -DXS_VERSION=\"4.050\" -iwithsysroot "/Sys +tem/Library/Perl/5.28/darwin-thread-multi-2level/CORE" dbdimp.c In file included from dbdimp.c:15: ./dbdimp.h:20:10: fatal error: 'DBIXS.h' file not found #include <DBIXS.h> /* installed by the DBI module + */ ^~~~~~~~~ 1 error generated. make: *** [dbdimp.o] Error 1 DVEEDEN/DBD-mysql-4.050.tar.gz /usr/bin/make -- NOT OK Failed during this command: DVEEDEN/DBD-mysql-4.050.tar.gz : make NO

I find that there are a number of copies of DBIXS.h in various places on my system:

/Applications/ +eveloper/SDKs/MacOSX.sdk/System/Library/Perl/Extras/5.30/darwin-threa +d-multi-2level/auto/DBI/DBIXS.h /Applications/ +eveloper/SDKs/MacOSX.sdk/System/Library/Perl/Extras/5.28/darwin-threa +d-multi-2level/auto/DBI/DBIXS.h /Applications/ +eveloper/SDKs/MacOSX.sdk/System/Library/Perl/Extras/5.18/darwin-threa +d-multi-2level/auto/DBI/DBIXS.h /Library/Perl/5.18/darwin-thread-multi-2level/auto/DBI/DBIXS.h /Users/mrb/.cpan/build/DBI-1.643-46wMR_/blib/arch/auto/DBI/DBIXS.h /Users/mrb/.cpan/build/DBI-1.643-46wMR_/DBIXS.h

How do I help the CPAN module find what it needs?

Replies are listed 'Best First'.
Re: Error installing DBD::mysql: file DBIXS.h not found
by 1nickt (Abbot) on Dec 26, 2020 at 21:18 UTC

    Hi, many people myself included strongly recommend against using the system Perl on Mac OS. That belongs to the OS. Don't install any libraries into it or count on it continuing to work from version to version.

    Instead, use perlbrew to install and manage various Perl versions under your home directory.

    This may seem tangential to your immediate issue, but I assure you it is best practise and will likely solve your problem with no further ado, not to mention prevent further ones down the line.

    Hope this helps!

    The way forward always starts with a minimal test.
Re: Error installing DBD::mysql: file DBIXS.h not found
by kcott (Bishop) on Dec 27, 2020 at 18:08 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11125755]
Approved by 1nickt
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2021-04-22 10:56 GMT
Find Nodes?
    Voting Booth?

    No recent polls found