Python, Django and LAMPP
If, for whatever reason, you are running MySQL from your LAMPP installation and try to use Python's MySQLdb API to connect to MySQL server you will get the following nasty error into your face:
ImportError: libmysqlclient_r.so.15: cannot open shared object file
The problem is that lampp, in its attemt to not disturb the rest of the OS space, does not expose some crucial shared libraries (like: mysql client, ssl etc.) to Linux at large and Python is unable to find them even though they are installed under LAMPP.
The solution is quite easy (NO! Do NOT use LD_LIBRARY_PATH, that's evil). We need to tell LD to look for additional libraries.
For that, we need to create a lampp.conf file under /etc/ld.so.conf.d/ and insert following two lines in it:
/opt/lampp/lib/mysql /opt/lampp/lib
When that's done, we tell LD to reload config by issuing:
sudo /sbin/ldconfig
Voila!
