cannot open shared object file or directory

chris (2005-08-10 10:35:56)
0 replies
This is an annoying problem which occurs with some installations of mysql 4.1. For some reason the isn't installed and clients which us the static objects (such as Perl::DBI) die with the following message: cannot open shared object file

In my case, I was running one of the mailer scripts for dotcut (formerly known as Carnival). The whole error looked like this:
root@nikita:/export/dotcut/bin# /export/dotcut/bin/
install_driver(mysql) failed: Can't load '/usr/lib/perl5/site_perl/5.8.4/i486-linux/auto/DBD/mysql/' for module DBD::mysql: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.4/i486-linux/ line 230.
 at (eval 11) line 3
Compilation failed in require at (eval 11) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at /usr/lib/perl5/5.8.4/Carnival/ line 12

The clue to fixing this problem is that the is missing. I ran 'locate' on the system and in fact it didn't exist at all. However, this was fixed with a very quick and dirty sybolic link hack like so:

ln -s /usr/lib/mysql/ /usr/lib/mysql/

The end result is a working mysql-client.