DBD-mysql icon indicating copy to clipboard operation
DBD-mysql copied to clipboard

Installation on a Mac 12.1

Open davehodg opened this issue 3 years ago • 2 comments
trafficstars

Getting the tarball from CPAN (4.050) DBD::MySQL appears to require libcrypto and libnsl.

Can I get them from anywhere or use different flags? brew thinks libnsl is linux only and doesn't know about libcrypto.

davehodg avatar Feb 22 '22 18:02 davehodg

I’m not sure why MySQL would require libsnl. Is this possibly a typo for libssl?

FWIW, I have this issue on macOS 10.15.7:

Can't link/include C library 'ssl', 'crypto', aborting.

#337 mentions a patch to remove those dependencies. DBD::MariaDB seems to work fine here though (with MariaDB from Homebrew), so I guess I’ll just be using that instead.

johannessen avatar Mar 21 '22 13:03 johannessen

I had to dig a little deeper to fix another script of mine. Turns out my problem was due to an issue in the mysql_config script, which Homebrew installs as a symlink as part of the MariaDB installation. Specifically, the function get_full_path() in that script is supposed to resolve the symlink, but fails to do so because Homebrew creates the symlink as relative rather than absolute path.

For MariaDB, the mysql_config script is supposed to simply call mariadb_config, but because of the symlink resolution issue, this never happens.

Fortunately, DBD::mysql allows the user to choose a different config script during configuration, as documented under "Environment Variables" in DBD::mysql::INSTALL:

DBD_MYSQL_CONFIG=mariadb_config cpanm DBD::mysql

Doing the install like this succeeds on my system (with MariaDB).

johannessen avatar Mar 21 '22 19:03 johannessen