install_driver(mysql) failed: Can't load

chris (2007-02-21 14:01:11)
0 replies
When mysql client libraries are missing, you'll get errors - often followed by 'install_driver(mysql) failed: Can't load - error while loading shared libraries: cannot open shared object file: No such file or directory'. This all looks pretty nasty. The first thing to do is to look around for your file to see if perhaps it's just installed in the wrong place. This might happen if you set an incorrect prefix at compile time, or if your dynamic linker doesn't know where to look for it.

Let's say that you can't find the file - what do you do next? Well first you need to download the sources and build and install the client libraries on your system. The following command dialogue explains how that is done:

root@baikal:~# ftp
Connected to
220 Welcome to MySQL AB's FTP service
Name ( anonymous
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub/mysql/src
250 Directory successfully changed.
ftp> bin
200 Switching to Binary mode.
ftp> prompt
Interactive mode off.
ftp> get mysql-5.0.28.tar.gz
local: mysql-5.0.28.tar.gz remote: mysql-5.0.28.tar.gz
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for mysql-5.0.28.tar.gz (25873293 bytes).
226 File send OK.
25873293 bytes received in 55 secs (4.6e+02 Kbytes/sec)

So first you download the mysql sources.
You can then extract the source directory and start compiling:

root@baikal:~# tar -zxvf mysql-5.0.28.tar.gz
root@baikal:~# cd mysql-5.0.28
root@baikal:~# ./configure --without-server && make && make install

At this point, you're just about complete. So try running your script again (or whatever it was which was spitting out the missing errors earlier on). If this still isn't running, then you need to check again where the library is installed and make sure that your dynamic linker can find it:

root@baikal:~# updatedb && locate

Ahh - so the file is in /usr/local/lib. Now let's check the to see if that location is included in the search paths for ld:

root@baikal:~# cat /etc/

It isn't! So all we need to do is add the following line to that file, then run 'ldconfig' and then try again:

/usr/local/lib/mysql <-- add this to the

root@baikal:~# ldconfig

Now you should be ready to roll!!

hope that's useful