Problems with Perl DBI / DBD on OSX 10.9 Mavericks

After upgrading to OSX Mavericks, I cannot start DBI / DBD.

Perl and MySQL are working fine (I can log into mysql and access my tables), but my Perl scripts can no longer use DBI, as the updater removed all my previously working Perl modules.

I reinstalled DBI and DBD :: mysql using CPAN, which installed them in / opt / local / lib / perl 5 / site_perl / 5.12.4 / darwin-multi-2level /. After copying the modules (DBI, DBD and everything in the "auto") to / Library / Perl / 5.16 / darwin-multi-2level / (since the directory used by cpan is not in @INC), my scripts return an internal server error (even with FatalsToBrowser).

The Apache error log says:

dyld: lazy symbol binding failed: Symbol not found: _Perl_Istack_sp_ptr Referenced from: /opt/local/lib/perl5/site_perl/5.12.4/darwin-multi-2level/auto/DBI/DBI.bundle Expected in: flat namespace dyld: Symbol not found: _Perl_Istack_sp_ptr Referenced from: /opt/local/lib/perl5/site_perl/5.12.4/darwin-multi-2level/auto/DBI/DBI.bundle Expected in: flat namespace Premature end of script headers: test.pl 

What is the problem? Maybe because I copied the files? Maybe I should force CPAN to install directly on / Library / Perl / 5.16 /? How can I tell CPAN to do this?

Any ideas?

+7
perl dbi osx-mavericks macos dbd
source share
6 answers

I did not upgrade to Mavericks because Apple does not care about the modifications that Apache, PHP, or Perl make when updating the OS - they just delete them all. I don't know if the following list will work well for you, but it worked for me with Lion and Mountain Lion:

  • Before starting, the x64 version of MySQL x86 must be installed and configured.
  • Install Xcode from the App Store.
  • In Xcode, open the Settings / Downloads menu, and then install the command line tools.

Install DBI:

  • Install cpanm with this command: sudo cpan App::cpanminus .
  • Install DBI: sudo cpanm DBI .

Install DBD :: mysql:

  • Get the necessary files from CPAN. Open the CPAN terminal: sudo perl -MCPAN -e 'shell' .
  • Then run the following commands: get DBD::mysql and exit .
  • Before compiling, you need to create some alias, because MySQL on Mac is installed differently than on Linux - at least that was true in previous versions of OS X.

cd / usr / local

sudo mkdir lib

cd lib

sudo ln -s / usr / local / mysql / lib / *. dylib.

  • Finally, you must install and compile the library:

cd ~ / .cpan / build / DBD * /

sudo perl Makefile.PL --testuser = 'yourmysqluser' --testpassword = 'yourmysqlpassword'

sudo make

sudo make test

sudo make install

In cd ~/.cpan/build/DBD*/ , under * , I mean that you have to write the actual path to the files you just downloaded from CPAN. The directory name changes depending on the latest version, but it is easy to find it with a simple ls .

Hope this works for you.


EDIT

It was a compilation that I did with several unsuccessful attempts, but I think I should name my sources:

http://bixsolutions.net/forum/thread-8.html

http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion

Warning: mysql_connect (): [2002] There is no such file or directory (attempt to connect via unix: ///tmp/mysql.sock) in

+10
source share

Information from 5.12 and 5.16 is in place. To fix the error, update CPAN and reinstall the modules:

 sudo cpan install CPAN reload cpan install <module> 
+2
source share

I had an existing MySQL configuration when I upgraded to OS X 10.9, with a user port (I use Boxen ). The easiest way for me, which worked flawlessly, is the initial installation .

 # extract the archive, etc. perl Makefile.PL --testuser=myuser --testpassword=pass --testport=13306 make make test # if all went well with the test make install 
0
source share

I ran into this problem with Mavericks OS. The solution that worked for me was a mixture of some of the things I saw on the net:

  • Install the latest command line tools (Apple web developer site):
    $sudo perl -MCPAN -e shell

  • Use cpan to install the DBI and DBD modules: mysql. I ran into a problem here when lipo crashes.

  • Work with the latest version of CommandLineTools lipo:
    $sudo mv /usr/bin/lipo /usr/bin/lipo.orig
    $sudo ln -s /Library/Developer/CommandLineTools/usr/bin/lipo /usr/bin

  • Finally, reinstall DBI, DBD: mysql modules using cpan install DBI, cpan install DBD :: mysql

0
source share

Mavericks installs Perl 5.16, although it does not remove previous 5.12 binaries. In addition, I installed other software that stored another copy of Perl 5.12 under /opt/local/bin (I think it was MacPorts, I probably used it to install cpan), and this directory was listed in my profile bash.

This means that CPAN used 5.12 to compile binary files, while Apache used 5.16, so some things worked in the terminal, while web scripts crashed.

Removing /opt/local/bin from $PATH and reinstalling DBI and DBD manually finally fixed the problem.

0
source share

For me, I completely uninstalled MySql and installed an older 32-bit version, as described on this stackoverflow page: MySQL pid is complete (mysql cannot start)

Then you need to force Perl to run 32-bit mode only by entering the following into the terminal (credit to Simon in AskDifferent ):

 defaults write com.apple.versioner.perl Prefer-32-Bit -bool yes 
0
source share

All Articles